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)
commite39c0ffe8cc3cce212928168236bfd0c22965235
tree36e0cecb0e86de0a5d51f04cfe0ca70101cd4d4d
parente2c2e7987106efbb576d7a46fbc9298fafd0b844
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