Whamcloud - gitweb
Fix bug; if a partition has no known type, don't derference a null
authorTheodore Ts'o <tytso@mit.edu>
Thu, 6 Mar 2003 17:58:03 +0000 (12:58 -0500)
committerTheodore Ts'o <tytso@mit.edu>
Thu, 6 Mar 2003 17:58:03 +0000 (12:58 -0500)
pointer and crash.

lib/blkid/ChangeLog
lib/blkid/devname.c

index a5b06a6..a49a16a 100644 (file)
@@ -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
index df77001..3a00146 100644 (file)
@@ -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;
 }