Fix for NULL pointer dereference defect.

Pointer 'disk' returned from call to function '_get_imsm_disk' at line
700 may be NULL and will be dereferenced at line 710.

Signed-off-by: Artur Wojcik <artur.wojcik@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
This commit is contained in:
Artur Wojcik 2009-12-10 12:03:40 -07:00 committed by Dan Williams
parent 4e9d21862d
commit d362da3dfe
1 changed files with 1 additions and 1 deletions

View File

@ -703,7 +703,7 @@ static void print_imsm_disk(struct imsm_super *mpb, int index, __u32 reserved)
char str[MAX_RAID_SERIAL_LEN + 1];
__u64 sz;
if (index < 0)
if (index < 0 || !disk)
return;
printf("\n");