[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[lvm-devel] LVM2/lib/cache lvmcache.c



CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	zkabelac sourceware org	2012-02-13 14:26:15

Modified files:
	lib/cache      : lvmcache.c 

Log message:
	Add internal error to guard vgname2 NULL dereference

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/cache/lvmcache.c.diff?cvsroot=lvm2&r1=1.125&r2=1.126

--- LVM2/lib/cache/lvmcache.c	2012/02/12 23:01:19	1.125
+++ LVM2/lib/cache/lvmcache.c	2012/02/13 14:26:15	1.126
@@ -321,13 +321,17 @@
 		if (!dm_hash_get_data(_lock_hash, n))
 			return_0;
 
-		vgname2 = dm_hash_get_key(_lock_hash, n);
+		if (!(vgname2 = dm_hash_get_key(_lock_hash, n))) {
+			log_error(INTERNAL_ERROR "VG lock %s hits NULL.",
+				 vgname);
+			return 0;
+		}
 
 		if (!_vgname_order_correct(vgname2, vgname)) {
 			log_errno(EDEADLK, INTERNAL_ERROR "VG lock %s must "
 				  "be requested before %s, not after.",
 				  vgname, vgname2);
-			return_0;
+			return 0;
 		}
 	}
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]