1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-03 05:18:29 +03:00

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.
This commit is contained in:
Zdenek Kabelac 2012-02-27 11:23:15 +00:00
parent ceec205594
commit 530efdb525
3 changed files with 5 additions and 2 deletions

View File

@ -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.

View File

@ -186,6 +186,7 @@ static struct volume_group *_format1_vg_read(struct format_instance *fid,
DM_LIST_INIT(pvs);
/* Strip dev_dir if present */
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)))

View File

@ -110,6 +110,7 @@ static struct volume_group *_pool_vg_read(struct format_instance *fid,
/* We can safely ignore the mda passed in */
/* Strip dev_dir if present */
if (vg_name)
vg_name = strip_dir(vg_name, fid->fmt->cmd->dev_dir);
/* Set vg_name through read_pool_pds() */