Whamcloud - gitweb
EX-6130 lipe: s_volume_name not NUL terminated
authorAlexandre Ioffe <aioffe@ddn.com>
Wed, 12 Oct 2022 00:53:20 +0000 (17:53 -0700)
committerAndreas Dilger <adilger@whamcloud.com>
Fri, 14 Oct 2022 19:56:25 +0000 (19:56 +0000)
commit00aede1e95a08e413825598efcd1a8cece49f20a
tree84643b2894726f8d756fa44a58d6528487139134
parent9e5e61e778e42e5d7494704b2f27f467365660b6
EX-6130 lipe: s_volume_name not NUL terminated

s_volume_name field stores string, but the field may have no
termination NUL if the string size equal the size of the field.
Therefore on some target systems the definition of
struct ext2_super_block s_volume_name in
/usr/include/ext2fs/ext2_fs.h may have
attribute "nonstring". In such case it conflicts with calls
which require NUL terminated string.
The fix replaces NUL-terminated string calls by calls with
limited string size (e.g. strlen() -> strnlen())

Signed-off-by: Alexandre Ioffe <aioffe@ddn.com>
Change-Id: Ieb1921a289328a8f9bfae9bb658c6c74f8ec43b7
Reviewed-on: https://review.whamcloud.com/c/ex/lustre-release/+/48829
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
lipe/src/lipe_scan3/ls3_scan.c