From: Hawrylewicz Czarnowski, Przemyslaw Date: Mon, 6 Dec 2010 06:40:40 +0000 (+0000) Subject: fix: incremental on invalid container causes segfault X-Git-Tag: mdadm-3.2~192 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a92b211229f4f8b3fd725b90f0517bc492cf70a4;p=thirdparty%2Fmdadm.git fix: incremental on invalid container causes segfault counterpart of 417f346ee0 for incremental. If md device has metadata_version="none" super_by_fd() matches supertype=super0. Call of load_container() dereferences null, so we have to forbid it. Signed-off-by: Przemyslaw Czarnowski Signed-off-by: NeilBrown --- diff --git a/Incremental.c b/Incremental.c index 8cae1ee5..9399f5be 100644 --- a/Incremental.c +++ b/Incremental.c @@ -134,7 +134,7 @@ int Incremental(char *devname, int verbose, int runstop, if (must_be_container(dfd)) { if (!st) st = super_by_fd(dfd, NULL); - if (st) + if (st && st->ss->load_container) rv = st->ss->load_container(st, dfd, NULL); close(dfd);