]> git.baikalelectronics.ru Git - kernel.git/commit
bcache: Use scnprintf() for avoiding potential buffer overflow
authorTakashi Iwai <tiwai@suse.de>
Sun, 22 Mar 2020 06:03:03 +0000 (14:03 +0800)
committerJens Axboe <axboe@kernel.dk>
Sun, 22 Mar 2020 16:06:57 +0000 (10:06 -0600)
commit514d8a53b94e3e63489b145e30de98195af13918
treec8cd41f891b631399a578b22e7fd1ce115441f82
parent88d2b0d3be5c92c6d1716681aea04368c120ce84
bcache: 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: Coly Li <colyli@suse.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/md/bcache/sysfs.c