]> git.baikalelectronics.ru Git - kernel.git/commit
tty: serial: pch_uart: Use scnprintf() for avoiding potential buffer overflow
authorTakashi Iwai <tiwai@suse.de>
Wed, 11 Mar 2020 09:29:30 +0000 (10:29 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 Mar 2020 11:59:29 +0000 (12:59 +0100)
commit88020378e0fc2d1f3cb51501551911bbb5c1e9ba
tree36e0cecb0e86de0a5d51f04cfe0ca70101cd4d4d
parent76c68ee88bcd43d215fba7cdea44c3aad7270f14
tty: serial: pch_uart: 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().

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20200311092930.24433-1-tiwai@suse.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/pch_uart.c