Whamcloud - gitweb
LU-17816 llapi: ensure pool name is nul terminated 18/55018/2
authorShaun Tancheff <shaun.tancheff@hpe.com>
Mon, 6 May 2024 09:26:22 +0000 (16:26 +0700)
committerOleg Drokin <green@whamcloud.com>
Wed, 29 May 2024 04:48:04 +0000 (04:48 +0000)
commit64469274a4f3e202c76cf9a2757b8f36e8d0ee08
treeb6d2f2427e4bff622ba19587a3afabeaef939813
parent0d3a9607655adc8f9dd4ae1c341bde0b57fe88bf
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)")

Signed-off-by: Shaun Tancheff <shaun.tancheff@hpe.com>
Change-Id: Idec7adaf89c9dabc0275687c4a069fc8fa63e7a7
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/55018
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Petros Koutoupis <petros.koutoupis@hpe.com>
Reviewed-by: Oleg Drokin <green@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