Thread (24 messages) 24 messages, 3 authors, 2011-11-02
STALE5344d

[PATCH 18/19] validate_geometry_imsm_volume(): Avoid NULL pointer dereference

From: <hidden>
Date: 2011-11-01 15:09:34
Subsystem: the rest · Maintainer: Linus Torvalds

From: Jes Sorensen <redacted>

Signed-off-by: Jes Sorensen <redacted>
---
 super-intel.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/super-intel.c b/super-intel.c
index 34a4b34..0193fe7 100644
--- a/super-intel.c
+++ b/super-intel.c
@@ -5139,7 +5139,7 @@ static int validate_geometry_imsm_volume(struct supertype *st, int level,
 {
 	struct stat stb;
 	struct intel_super *super = st->sb;
-	struct imsm_super *mpb = super->anchor;
+	struct imsm_super *mpb;
 	struct dl *dl;
 	unsigned long long pos = 0;
 	unsigned long long maxsize;
@@ -5150,6 +5150,8 @@ static int validate_geometry_imsm_volume(struct supertype *st, int level,
 	if (!super)
 		return 0;
 
+	mpb = super->anchor;
+
 	if (mpb->num_raid_devs > 0 && mpb->num_disks != raiddisks) {
 		fprintf(stderr, Name ": the option-rom requires all "
 			"member disks to be a member of all volumes.\n");
-- 
1.7.6.4
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help