Whamcloud - gitweb
LU-17718 obdclass: potential string overflow upcall_cache.c
authorSebastien Buisson <sbuisson@ddn.com>
Tue, 9 Apr 2024 13:00:41 +0000 (15:00 +0200)
committerAndreas Dilger <adilger@whamcloud.com>
Tue, 11 Jun 2024 07:00:11 +0000 (07:00 +0000)
commitcdc5bd11627e6da09c4e96c324b3b14416f5908a
tree54cf76eaa0947ef503047ca123ac97016c6b476f
parent23de659301e62bb891c5ee8c83817c3951beddfe
LU-17718 obdclass: potential string overflow upcall_cache.c

Use strncpy() in upcall_cache_set_upcall() to quiet Coverity warning.
And reorganize the function so that the code flow is more linear in
the success case.

CoverityID: 424705: ("String overflow")

Lustre-change: https://review.whamcloud.com/54710
Lustre-commit: 7869bb320e735547410a7d3e31061b9044389c53

Fixes: a462a119ec ("LU-17497 obdclass: check upcall incorrect values")
Signed-off-by: Sebastien Buisson <sbuisson@ddn.com>
Change-Id: I1aee77f78c92c6c571dfe358435a2733cc3ba9d9
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/c/ex/lustre-release/+/55314
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
lustre/obdclass/upcall_cache.c
lustre/tests/sanity-sec.sh