OSDN Git Service

net: netdevsim: Use scnprintf() for avoiding potential buffer overflow
authorTakashi Iwai <tiwai@suse.de>
Sun, 15 Mar 2020 09:35:03 +0000 (10:35 +0100)
committerDavid S. Miller <davem@davemloft.net>
Mon, 16 Mar 2020 00:06:22 +0000 (17:06 -0700)
commit2da222f612b58b6e6b41972f46005b58aac1699e
tree0158c85ae4a0e88363acec4ea23c0049983b7605
parent5e892880e14fbc1944f49aa42a67496516fe5dac
net: netdevsim: Use scnprintf() for avoiding potential buffer overflow

Since snprintf() returns the would-be-output size instead of the
actual output size, the succeeding calls may go beyond the given
buffer limit.  Fix it by replacing with scnprintf().

Cc: "David S . Miller" <davem@davemloft.net>
Cc: Jakub Kicinski <kuba@kernel.org>
Cc: netdev@vger.kernel.org
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/netdevsim/ipsec.c