summaryrefslogtreecommitdiff
path: root/lib/blkid/devname.c
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2008-08-22 12:43:14 -0400
committerTheodore Ts'o <tytso@mit.edu>2008-08-22 12:43:14 -0400
commit5b7adf06904e6577c5d8bee7f0197a1b1032fa68 (patch)
tree6061cfc4aaeeefd46dbea60bdb4084a7ec303f2a /lib/blkid/devname.c
parent1aaaa82901c8b0a50baff06491f0e8e7de1c9af3 (diff)
downloade2fsprogs-5b7adf06904e6577c5d8bee7f0197a1b1032fa68.tar.gz
libblkid: Fix potential crash if blkid cache is out of date when probing
Fix bug added in 57926c8c5566f0ef5b77db326d58aa0643cf6270 Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'lib/blkid/devname.c')
-rw-r--r--lib/blkid/devname.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/blkid/devname.c b/lib/blkid/devname.c
index 89b33f21..86fd44cb 100644
--- a/lib/blkid/devname.c
+++ b/lib/blkid/devname.c
@@ -129,12 +129,12 @@ static void probe_one(blkid_cache cache, const char *ptname,
dev_t devno, int pri, int only_if_new)
{
blkid_dev dev = NULL;
- struct list_head *p;
+ struct list_head *p, *pnext;
const char **dir;
char *devname = NULL;
/* See if we already have this device number in the cache. */
- list_for_each(p, &cache->bic_devs) {
+ list_for_each_safe(p, pnext, &cache->bic_devs) {
blkid_dev tmp = list_entry(p, struct blkid_struct_dev,
bid_devs);
#ifdef HAVE_DEVMAPPER