OSDN Git Service

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)
commit7cd37a0006b0489c3e6cc766b1b3f3d5e4c3a4f2
tree067f177c9a9442c7885af19d37f3424d4a71e4e3
parent034851049082d084a6e616900293e14590b4e0e1
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