]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
Fix for NULL pointer dereference defect.
authorArtur Wojcik <artur.wojcik@intel.com>
Thu, 10 Dec 2009 19:03:39 +0000 (12:03 -0700)
committerDan Williams <dan.j.williams@intel.com>
Thu, 10 Dec 2009 19:03:39 +0000 (12:03 -0700)
Pointer 'st' returned from call to function 'malloc' at line 320 may
be NULL and it will be dereferenced at line 321.

Signed-off-by: Artur Wojcik <artur.wojcik@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
super-intel.c

index cf6288f03709c5ccffe6af373fc7f75b99e49fa5..a2acaaf2429ed9592518998204702c84d5a87ffd 100644 (file)
@@ -318,6 +318,8 @@ static struct supertype *match_metadata_desc_imsm(char *arg)
                return NULL;
 
        st = malloc(sizeof(*st));
+       if (!st)
+               return NULL;
        memset(st, 0, sizeof(*st));
        st->ss = &super_imsm;
        st->max_devs = IMSM_MAX_DEVICES;