]> git.baikalelectronics.ru Git - kernel.git/commit
net: caif: Use scnprintf() for avoiding potential buffer overflow
authorTakashi Iwai <tiwai@suse.de>
Sun, 15 Mar 2020 09:34:58 +0000 (10:34 +0100)
committerDavid S. Miller <davem@davemloft.net>
Mon, 16 Mar 2020 00:06:22 +0000 (17:06 -0700)
commit8e3da440b2ad7bbb21d85d4da36b5e3be1000395
tree9e575a199d5330aa7c1240b5b6253d59f642db37
parentb3d964ddeaa4b0994d124cdc641db6673f342399
net: caif: 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: netdev@vger.kernel.org
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/caif/caif_spi.c