]> git.baikalelectronics.ru Git - kernel.git/commit
net: nfp: Use scnprintf() for avoiding potential buffer overflow
authorTakashi Iwai <tiwai@suse.de>
Sun, 15 Mar 2020 09:35:00 +0000 (10:35 +0100)
committerDavid S. Miller <davem@davemloft.net>
Mon, 16 Mar 2020 00:06:22 +0000 (17:06 -0700)
commit54535ec99a5874977374d6d7fa77482c8bc702e6
tree997b6c785c2a41365f9b197fc45144ebc143c025
parent7a0cd0b914de0c0220eb20f577bcdd8b532fd263
net: nfp: 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().

Reviewed-by: Simon Horman <simon.horman@netronome.com>
Cc: "David S . Miller" <davem@davemloft.net>
Cc: Jakub Kicinski <kuba@kernel.org>
Cc: oss-drivers@netronome.com
To: netdev@vger.kernel.org
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/netronome/nfp/nfpcore/nfp6000_pcie.c