]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: use correct string length in DEV_INFO ioctl
authorXiongfeng Wang <xiongfeng.wang@linaro.org>
Mon, 8 Jan 2018 11:51:22 +0000 (19:51 +0800)
committerDavid Sterba <dsterba@suse.com>
Mon, 22 Jan 2018 15:08:21 +0000 (16:08 +0100)
commit24c881cf4aa9e32de079b43a0d8e04514ae7c9f8
tree774ef2a1c3266b19e4be07829686c4f2129bae90
parenta4031dab97e708a945203cc84985b4cc26c734ef
btrfs: use correct string length in DEV_INFO ioctl

gcc-8 reports:

fs/btrfs/ioctl.c: In function 'btrfs_ioctl':
./include/linux/string.h:245:9: warning: '__builtin_strncpy' specified
bound 1024 equals destination size [-Wstringop-truncation]

We need one less byte or call strlcpy() to make it a nul-terminated
string. This is done on the next line anyway, but we want to avoid the
warning.

Signed-off-by: Xiongfeng Wang <xiongfeng.wang@linaro.org>
Reviewed-by: David Sterba <dsterba@suse.com>
[ update changelog ]
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/ioctl.c