diff --git a/lib/format1/format1.c b/lib/format1/format1.c index 2eb2f4aff..b832a4784 100644 --- a/lib/format1/format1.c +++ b/lib/format1/format1.c @@ -163,6 +163,8 @@ static int _vg_write(struct io_space *is, struct volume_group *vg) return 0; } + INIT_LIST_HEAD(&pvs); + r = _flatten_vg(mem, vg, &pvs, is->prefix) && write_pvs(&pvs); pool_destroy(mem); return r; diff --git a/lib/format1/import-export.c b/lib/format1/import-export.c index 3ce4b58f2..08afbf9da 100644 --- a/lib/format1/import-export.c +++ b/lib/format1/import-export.c @@ -127,7 +127,7 @@ int export_pv(struct pv_disk *pvd, struct physical_volume *pv) memset(pvd->vg_name, 0, sizeof(pvd->vg_name)); if (pv->vg_name) - strcpy(pvd->vg_name, pv->vg_name); + strncpy(pvd->vg_name, pv->vg_name, sizeof(pvd->vg_name)); //pvd->pv_major = MAJOR(pv->dev); //pvd->pv_number = ??;