summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2003-03-06 12:58:03 -0500
committerTheodore Ts'o <tytso@mit.edu>2003-03-06 12:58:03 -0500
commitcd0d521b829eca264f65f154373b0324db57d705 (patch)
tree0614c423bf9625f0aa63db29743617daf0d95da2
parent77be4d2df1a868ea7d5af2e469c1eb440fc21002 (diff)
downloade2fsprogs-cd0d521b829eca264f65f154373b0324db57d705.tar.gz
Fix bug; if a partition has no known type, don't derference a null
pointer and crash.
-rw-r--r--lib/blkid/ChangeLog5
-rw-r--r--lib/blkid/devname.c3
2 files changed, 7 insertions, 1 deletions
diff --git a/lib/blkid/ChangeLog b/lib/blkid/ChangeLog
index a5b06a6c..a49a16a8 100644
--- a/lib/blkid/ChangeLog
+++ b/lib/blkid/ChangeLog
@@ -1,3 +1,8 @@
+2003-03-06 <tytso@mit.edu>
+
+ * devname.c (probe_one): Fix bug; if a partition has no known
+ type, don't derference a null pointer and crash.
+
2003-03-06 Theodore Tso <tytso@mit.edu>
* blkid_types.h.in: Don't redefine types if other e2fsprogs
diff --git a/lib/blkid/devname.c b/lib/blkid/devname.c
index df770018..3a00146f 100644
--- a/lib/blkid/devname.c
+++ b/lib/blkid/devname.c
@@ -129,7 +129,8 @@ static void probe_one(blkid_cache cache, const char *ptname,
set_pri:
if (!pri && !strncmp(ptname, "md", 2))
pri = BLKID_PRI_MD;
- dev->bid_pri = pri;
+ if (dev)
+ dev->bid_pri = pri;
return;
}