mirror_zfs/module
Tomohiro Kusumi f0ce0436aa Correct snprintf() size argument
The size argument of snprintf(3) in glibc and snprintf() in Linux
kernel includes trailing \0, as snprintf(3) man page explains it as
"write at most size bytes (including the trailing null byte ('\0'))",
i.e. snprintf() can just take buffer size.

e.g. For snprintf() in module/zfs/zfs_ctldir.c, a buffer size is
MAXPATHLEN, and a caller is passing MAXPATHLEN to snprintf(), so size
should just be `path_len` to do what the caller is trying to do.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: George Melikov <mail@gmelikov.ru>
Reviewed-by: Richard Laager <rlaager@wiktel.com>
Signed-off-by: Tomohiro Kusumi <kusumi.tomohiro@gmail.com>
Closes #8692
2019-04-30 19:41:12 -07:00
..
avl Update build system and packaging 2018-05-29 16:00:33 -07:00
icp Restructure vec_idx loops 2019-04-16 12:34:06 -07:00
lua Update build system and packaging 2018-05-29 16:00:33 -07:00
nvpair Use NV_ENCODE_NATIVE for nvlist encoding variable 2019-04-26 11:24:31 -07:00
spl Correct snprintf() size argument 2019-04-30 19:41:12 -07:00
unicode Update build system and packaging 2018-05-29 16:00:33 -07:00
zcommon Add TRIM support 2019-03-29 09:13:20 -07:00
zfs Correct snprintf() size argument 2019-04-30 19:41:12 -07:00
.gitignore Prepare SPL repo to merge with ZFS repo 2018-05-29 14:51:39 -07:00
Makefile.in Linux 5.0 compat: Fix SUBDIRs 2019-01-28 10:11:45 -08:00