]> git.baikalelectronics.ru Git - kernel.git/commit
f2fs: Use scnprintf() for avoiding potential buffer overflow
authorTakashi Iwai <tiwai@suse.de>
Wed, 11 Mar 2020 09:33:53 +0000 (10:33 +0100)
committerJaegeuk Kim <jaegeuk@kernel.org>
Thu, 19 Mar 2020 18:37:56 +0000 (11:37 -0700)
commited962a5abf1d2e99a01e86a2956153dc3a653889
tree68e2690031ed012ca0d1b3671fecd34af8b4d31b
parentec5b2f1e4f78b74587949ccec6646e1fb5e9363b
f2fs: 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>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/sysfs.c