diff options
author | Theodore Ts'o <tytso@mit.edu> | 2008-07-13 19:10:10 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2008-07-13 19:10:10 -0400 |
commit | bb47c2a4aff6ec6b9be7f30cd04cf7c858a84de4 (patch) | |
tree | a1f65b615a9ab39d4e26e5617c995fd5b0781c90 /lib/blkid/devname.c | |
parent | 4729455f0a68f2fa0a83ec8460d1d4bccba9dcfa (diff) | |
download | e2fsprogs-bb47c2a4aff6ec6b9be7f30cd04cf7c858a84de4.tar.gz |
libblkid: Make sure we never reference a null dev->bid_type
There were a few places where we don't check to make sure
dev->bid_type is non-NULL before dereferencing the pointer, mostly in
debug code.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'lib/blkid/devname.c')
-rw-r--r-- | lib/blkid/devname.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/blkid/devname.c b/lib/blkid/devname.c index df968599..65c6ccae 100644 --- a/lib/blkid/devname.c +++ b/lib/blkid/devname.c @@ -96,7 +96,8 @@ blkid_dev blkid_get_dev(blkid_cache cache, const char *devname, int flags) dev2 = list_entry(p, struct blkid_struct_dev, bid_devs); if (dev2->bid_flags & BLKID_BID_FL_VERIFIED) continue; - if (strcmp(dev->bid_type, dev2->bid_type)) + if (!dev->bid_type || !dev2->bid_type || + strcmp(dev->bid_type, dev2->bid_type)) continue; if (dev->bid_label && dev2->bid_label && strcmp(dev->bid_label, dev2->bid_label)) |