diff options
author | Artur Wojcik <artur.wojcik@intel.com> | 2009-12-10 20:03:39 +0100 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2009-12-10 20:03:39 +0100 |
commit | 791b666ae864cbd6f6c4513859afeb5fc624d02f (patch) | |
tree | f3f299775fd13e188bfcc317f1aa652637dfd1d3 /super-intel.c | |
parent | Fix for NULL pointer dereference. (diff) | |
download | mdadm-791b666ae864cbd6f6c4513859afeb5fc624d02f.tar.xz mdadm-791b666ae864cbd6f6c4513859afeb5fc624d02f.zip |
Fix for NULL pointer dereference.
Pointers '_dev' and '_disk' returned from call to function '_get_imsm_dev'
and '_get_imsm_disk' may be NULL and will be dereferenced at lines
2933 and 2934, respectively.
Signed-off-by: Artur Wojcik <artur.wojcik@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'super-intel.c')
-rw-r--r-- | super-intel.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/super-intel.c b/super-intel.c index 03dcbd5b..49e938dd 100644 --- a/super-intel.c +++ b/super-intel.c @@ -2938,6 +2938,10 @@ static int add_to_super_imsm_volume(struct supertype *st, mdu_disk_info_t *dk, struct imsm_dev *_dev = __get_imsm_dev(mpb, 0); struct imsm_disk *_disk = __get_imsm_disk(mpb, dl->index); + if (!_dev || !_disk) { + fprintf(stderr, Name ": BUG mpb setup error\n"); + return 1; + } *_dev = *dev; *_disk = dl->disk; sum = random32(); |