Whamcloud - gitweb
LU-18571 nodemap: fix coverity issues in range_create() 88/57488/3
authorSebastien Buisson <sbuisson@ddn.com>
Mon, 16 Dec 2024 20:04:56 +0000 (21:04 +0100)
committerOleg Drokin <green@whamcloud.com>
Thu, 2 Jan 2025 20:53:22 +0000 (20:53 +0000)
commit6fdb04e86a02a789785c59606e38c2ff9d4358c7
treefa29f60e488991c8b21f6ef34069a7772c899884
parent3a663e37c2944b24fa643764d8d9811af0d2453c
LU-18571 nodemap: fix coverity issues in range_create()

Fix issues found by Coverity in range_create():

CoverityID: 451797 ("Null pointer dereferences")
  Dereferencing a pointer that might be "NULL" "c" when calling
  "strscpy".

CoverityID: 451795 ("Integer handling issues")
  "netmask > 999" is always false regardless of the values of its
  operands. This occurs as the logical operand of "if."

Fixes: 8f6988be44 ("LU-14288 nodemap: Use nidmasks for IPv6 NIDs")
Signed-off-by: Sebastien Buisson <sbuisson@ddn.com>
Change-Id: I1a6f85f2c9a3591ddd82ed634e9a87902b2b7d0a
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/57488
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Chris Horn <chris.horn@hpe.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/ptlrpc/nodemap_range.c