segfault in imsm create with wrong arguments

When calling mdadm -C --metadata=imsm -l 1 /dev/sd..
mdadm segfaults in default_chunk_imsm()
above syntax is incorrect, but mdadm should error instead of segfaulting

Signed-off-by: Luca Berra <bluca@comedia.it>
Signed-off-by: NeilBrown <neilb@suse.de>
This commit is contained in:
Luca Berra 2010-12-12 11:33:55 +01:00 committed by NeilBrown
parent cd19c0cf1c
commit a2973b6af2
1 changed files with 1 additions and 1 deletions

View File

@ -4119,7 +4119,7 @@ static int default_chunk_imsm(struct supertype *st)
{
struct intel_super *super = st->sb;
if (!super->orom)
if (!super || !super->orom)
return 0;
return imsm_orom_default_chunk(super->orom);