Whamcloud - gitweb
LU-17504 libcfs: safer LIBCFS_ALLOC 15/55015/2
authorShaun Tancheff <shaun.tancheff@hpe.com>
Mon, 6 May 2024 05:11:15 +0000 (12:11 +0700)
committerOleg Drokin <green@whamcloud.com>
Wed, 29 May 2024 04:47:52 +0000 (04:47 +0000)
commit0d3a9607655adc8f9dd4ae1c341bde0b57fe88bf
tree72351979cdc064b7a32880163a988ef9e68115aa
parenteaf69257b6e1560a5d2abd86e78911009933ff50
LU-17504 libcfs: safer LIBCFS_ALLOC

Make the LIBCFS_ALLOC() family of macros safer by adding
parenthesis around arguments such as (size) to avoid uninteded
expansion.

CoverityID: 415056 ("Integer handling issues")

Fixes: 718e3f3e68 ("LU-17504 build: fix gcc-13 [-Werror=stringop-overread] error")
Signed-off-by: Shaun Tancheff <shaun.tancheff@hpe.com>
Change-Id: I9701f87025bc5ce038a6bf34413b64a3f019d998
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/55015
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Arshad Hussain <arshad.hussain@aeoncomputing.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
libcfs/include/libcfs/libcfs_private.h
libcfs/libcfs/hash.c