Whamcloud - gitweb
LU-17816 llapi: ensure pool name is nul terminated
authorShaun Tancheff <shaun.tancheff@hpe.com>
Wed, 15 May 2024 06:30:39 +0000 (23:30 -0700)
committerAndreas Dilger <adilger@whamcloud.com>
Thu, 30 May 2024 00:37:45 +0000 (00:37 +0000)
commit9520a4e4e522c181535100dd5530fb2a17c2b0ee
tree1cd35c146c39fb41025675dfb0917798d0463007
parentf50fe51ab9b060321be30caff105b401bebdc0d2
LU-17816 llapi: ensure pool name is nul terminated

strncpy() usage is inconsistent about the size of pool name
and sometimes for get to ensure a nul byte is placed at the
end of the copy.

CoverityID: 397181 ("Buffer not null terminated (BUFFER_SIZE)")

Also cleanup a case of checking that an unsigned value >= 0

CoverityID: 397820 ("Unsigned compared against 0 (NO_EFFECT)")

Lustre-change: https://review.whamcloud.com/55018
Lustre-commit: 64469274a4f3e202c76cf9a2757b8f36e8d0ee08

Signed-off-by: Shaun Tancheff <shaun.tancheff@hpe.com>
Change-Id: Idec7adaf89c9dabc0275687c4a069fc8fa63e7a7
Reviewed-on: https://review.whamcloud.com/c/ex/lustre-release/+/55119
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
lustre/include/uapi/linux/lustre/lustre_user.h
lustre/utils/lfs.c
lustre/utils/liblustreapi.c
lustre/utils/liblustreapi_layout.c
lustre/utils/obd.c