Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > by-pkgid > 1a193beeca253509f43ccfc4b958589c > files > 4

device-mapper-1.02.39-1.el5_5.2.src.rpm

--- LVM2.2.02.54.old/libdm/datastruct/hash.c	2008-11-03 19:59:59.000000000 +0100
+++ LVM2.2.02.54/libdm/datastruct/hash.c	2009-11-11 16:40:07.000000000 +0100
@@ -143,9 +143,13 @@ static struct dm_hash_node **_find(struc
 	unsigned h = _hash(key, len) & (t->num_slots - 1);
 	struct dm_hash_node **c;
 
-	for (c = &t->slots[h]; *c; c = &((*c)->next))
+	for (c = &t->slots[h]; *c; c = &((*c)->next)) {
+		if ((*c)->keylen != len)
+			continue;
+
 		if (!memcmp(key, (*c)->key, len))
 			break;
+	}
 
 	return c;
 }
diff -rup LVM2.2.02.54.old/WHATS_NEW_DM LVM2.2.02.54/WHATS_NEW_DM
--- LVM2.2.02.54.old/WHATS_NEW_DM	2009-10-27 01:52:45.000000000 +0100
+++ LVM2.2.02.54/WHATS_NEW_DM	2009-11-11 16:40:45.000000000 +0100
@@ -1,3 +1,7 @@
+Version 1.02.40 -
+===================================
+  Fix hash lookup segfault when keys compared are different lengths.
+
 Version 1.02.39 - 26th October 2009
 ===================================
   Remove strict default permissions for DM devices from 95-dm-notify.rules.