Whamcloud - gitweb
LU-9315 pfl: static analysis issues 03/26503/3
authorBobi Jam <bobijam.xu@intel.com>
Tue, 11 Apr 2017 17:34:32 +0000 (01:34 +0800)
committerOleg Drokin <oleg.drokin@intel.com>
Tue, 16 May 2017 05:48:17 +0000 (05:48 +0000)
commita6d463ff0b018e902afe63801c8b2c1e9a92ddc2
tree1034c526ab180b16bb4d568331a74aa22631db73
parent49f4bd032446a9f7c594b5b2ca130e2a45714262
LU-9315 pfl: static analysis issues

1. Buffer Overflow - Non-null Terminated String
 * lustre/utils/liblustreapi_layout.c: in llapi_layout_expected,
   Buffer overflow of 'donor_path' due to non null terminated string
   'donor_path'
2. Use of Freed Memory by Pointer
 * lustre/utils/liblustreapi_layout.c: in llapi_layout_comp_del,
   Object 'comp' was dereferenced at line 1770 after being freed by
   calling '__llapi_comp_free' at line 1769
3. Result of function that may return NULL will be dereferenced
 * lustre/lov/lov_pack.c: in lov_unpackmd, Pointer
   'lsm_op_find(magic)' returned from call to function 'lsm_op_find'
   at line 334 may be NULL and will be dereferenced at line 334.
4. Uninitialized Variable - possible
 * lustre/utils/liblustreapi.c: in find_check_comp_options, 'ret'
   might be used uninitialized in this function. Also there are 2
   similar errors on lines 3243, 3264.

Signed-off-by: Bobi Jam <bobijam.xu@intel.com>
Change-Id: I397737affeaa409e97b0ed859efcd7ff2840cc89
Reviewed-on: https://review.whamcloud.com/26503
Tested-by: Jenkins
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
lustre/lov/lov_pack.c
lustre/utils/liblustreapi.c
lustre/utils/liblustreapi_layout.c