Neil Brown: Avoid possible null dereference in Assemble.

Martin F. Krafft madduck at alioth.debian.org
Tue Jun 24 22:02:11 UTC 2008


Module: mdadm
Branch: master
Commit: ddd1a492519d61587cdd92660b875b82f4832176
URL:    http://git.debian.org/?p=pkg-mdadm/mdadm.git;a=commit;h=ddd1a492519d61587cdd92660b875b82f4832176

Author: Neil Brown <neilb at suse.de>
Date:   Thu May 15 15:50:42 2008 +1000

Avoid possible null dereference in Assemble.

If the first device we look at has no superblock,
there is no 'st' to free, so don't free it.

---

 Assemble.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/Assemble.c b/Assemble.c
index c7cc385..8621203 100644
--- a/Assemble.c
+++ b/Assemble.c
@@ -315,7 +315,8 @@ int Assemble(struct supertype *st, char *mddev, int mdfd,
 		if (!tst || !tst->sb) {
 			fprintf(stderr, Name ": %s has no superblock - assembly aborted\n",
 				devname);
-			st->ss->free_super(st);
+			if (st)
+				st->ss->free_super(st);
 			return 1;
 		}
 




More information about the pkg-mdadm-commits mailing list