]> git.baikalelectronics.ru Git - kernel.git/commit
HID: hid-sensor-custom: Use scnprintf() for avoiding potential buffer overflow
authorTakashi Iwai <tiwai@suse.de>
Wed, 11 Mar 2020 07:38:24 +0000 (08:38 +0100)
committerJiri Kosina <jkosina@suse.cz>
Wed, 11 Mar 2020 10:58:58 +0000 (11:58 +0100)
commiteb976e8cbf0b9d70a9c129123b31458537afdc81
tree5b04a64465ee8f2ce07898bbc81854e6c7adf1cf
parent7f376e4b79c930e59f4e7901ef88c94085254c81
HID: hid-sensor-custom: 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: Jiri Kosina <jkosina@suse.cz>
drivers/hid/hid-sensor-custom.c