hwmon: (ibmpowernv) Use scnprintf() for avoiding potential buffer overflow
authorTakashi Iwai <tiwai@suse.de>
Wed, 11 Mar 2020 07:39:44 +0000 (08:39 +0100)
committerGuenter Roeck <linux@roeck-us.net>
Wed, 11 Mar 2020 15:09:31 +0000 (08:09 -0700)
commit6a096871b2bedd524ce706aa687de4f7145f535c
treefcaa27f85d98e8a628c00abc9c247d6de5b20df5
parent86da28eed4fbc64dfdc386337f6cbac36c9c1ed2
hwmon: (ibmpowernv) 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>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
drivers/hwmon/ibmpowernv.c