Skip to contentSkip to conversation

LVM2 ./WHATS_NEW lib/raid/raid.c

PATCH [email protected] 1 participant 1 message Feb 27, 2012 MD RAID

lore
Share & tools
lore
#0 lore raw

CVSROOT: /cvs/lvm2
Module name: LVM2
Changes by: zkabelac at sourceware.org 2012-02-27 10:15:08

Modified files:
. : WHATS_NEW
lib/raid : raid.c

Log message:
Test seg pointer for non-null

As the function accepts NULL for 'seg' parameter, check for it before dereference.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.2313&r2=1.2314
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/raid/raid.c.diff?cvsroot=lvm2&r1=1.15&r2=1.16

WHATS_NEW +2 -1
@@ -1,5 +1,6 @@
 Version 2.02.94 - 
-====================================                       
+====================================
+  Test seg pointer for non-null it in raid_target_percent error path.
   Check for errors in _init_tags() during config loading.
   Always check result of _set_vg_name() in lvcreate.
   Drop unused call to uname() during clvmd initialization.
lib/raid/raid.c +1 -1
@@ -230,7 +230,7 @@
 	if (!pos || (sscanf(pos, "%" PRIu64 "/%" PRIu64 "%n",
 			    &numerator, &denominator, &i) != 2)) {
 		log_error("Failed to parse %s status fraction: %s",
-			  seg->segtype->name, params);
+			  (seg) ? seg->segtype->name : "segment", params);
 		return 0;
 	}