]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
"--export" segfaults with non-persistent super blocks
authorTim Woods <timwoods@uklinux.net>
Mon, 23 Jul 2007 07:15:52 +0000 (17:15 +1000)
committerNeil Brown <neilb@suse.de>
Mon, 23 Jul 2007 07:15:52 +0000 (17:15 +1000)
From: Tim Woods <timwoods@uklinux.net>

This patch fixes a NULL pointer dereference in Detail.c when running
'mdadm --detail --export' on a device with non-persistent super blocks.

Detail.c

index 7e141636bcc9450d7b8e566081d7622a725fb0a9..ed100fa1bbba104507884cd6c8e86d5ce1571877 100644 (file)
--- a/Detail.c
+++ b/Detail.c
@@ -137,7 +137,8 @@ int Detail(char *dev, int brief, int export, int test, char *homehost)
                printf("MD_DEVICES=%d\n", array.raid_disks);
                printf("MD_METADATA=%d.%d\n", array.major_version,
                       array.minor_version);
-               st->ss->export_super(super);
+               if (super)
+                       st->ss->export_super(super);
                goto out;
        }