]> git.baikalelectronics.ru Git - kernel.git/commit
lightnvm: pblk: Use scnprintf() for avoiding potential buffer overflow
authorTakashi Iwai <tiwai@suse.de>
Wed, 11 Mar 2020 07:44:39 +0000 (08:44 +0100)
committerJens Axboe <axboe@kernel.dk>
Thu, 12 Mar 2020 13:39:05 +0000 (07:39 -0600)
commit89fc35c35ca25fc649afcd0359ade6355d1b4bac
tree067f177c9a9442c7885af19d37f3424d4a71e4e3
parent7d5bfeda14ec04442cbd16679e64b9755f1a8c05
lightnvm: pblk: 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: Jens Axboe <axboe@kernel.dk>
drivers/lightnvm/pblk-sysfs.c