Skip to contentSkip to conversation

LVM2 ./WHATS_NEW lib/format1/format1.c lib/for ...

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

lore
Share & tools
lore
#0 lore raw

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

Modified files:
. : WHATS_NEW
lib/format1 : format1.c
lib/format_pool: format_pool.c

Log message:
Check for vg_name existance

Since vg_read() mda ops could be called with NULL vg_name, check it before derefence also for pool and format1.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.2315&r2=1.2316
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format1/format1.c.diff?cvsroot=lvm2&r1=1.148&r2=1.149
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format_pool/format_pool.c.diff?cvsroot=lvm2&r1=1.53&r2=1.54

WHATS_NEW +1 -0
@@ -1,5 +1,6 @@
 Version 2.02.94 - 
 ====================================
+  Check for existance of vg_name in _format1/_pool_vg_read().
   Fix missing break in _format_pvsegs (2.02.92).
   Test seg pointer for non-null it in raid_target_percent error path.
   Check for errors in _init_tags() during config loading.
lib/format1/format1.c +2 -1
@@ -186,7 +186,8 @@
 	DM_LIST_INIT(pvs);
 
 	/* Strip dev_dir if present */
-	vg_name = strip_dir(vg_name, fid->fmt->cmd->dev_dir);
+	if (vg_name)
+		vg_name = strip_dir(vg_name, fid->fmt->cmd->dev_dir);
 
 	if (!(vg = alloc_vg("format1_vg_read", fid->fmt->cmd, NULL)))
 		return_NULL;
lib/format_pool/format_pool.c +2 -1
@@ -110,7 +110,8 @@
 	/* We can safely ignore the mda passed in */
 
 	/* Strip dev_dir if present */
-	vg_name = strip_dir(vg_name, fid->fmt->cmd->dev_dir);
+	if (vg_name)
+		vg_name = strip_dir(vg_name, fid->fmt->cmd->dev_dir);
 
 	/* Set vg_name through read_pool_pds() */
 	if (!(vg = alloc_vg("pool_vg_read", fid->fmt->cmd, NULL)))