]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commitc501a3c1ecbfa491aa6d9860f9faf573bdfcedeb
tree0158c85ae4a0e88363acec4ea23c0049983b7605
parentd3b457d65b5b3870c1ffb3b8805421185ed344ca
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