From 45805cf888cda0e840d774f1d42cd21525a722ea Mon Sep 17 00:00:00 2001 From: Benjamin Gilbert Date: Wed, 16 Apr 2014 16:27:07 -0400 Subject: [PATCH] lvm: Fix segfault if a VG contains no LVs --- src/lvm.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/lvm.c b/src/lvm.c index 97d80170..cbf244b3 100644 --- a/src/lvm.c +++ b/src/lvm.c @@ -119,6 +119,8 @@ static void vg_read(vg_t vg, char const *vg_name) lvm_submit (vg_name, "free", lvm_vg_get_free_size(vg)); lvs = lvm_vg_list_lvs(vg); + if (lvs == NULL) + return; dm_list_iterate_items(lvl, lvs) { name = lvm_lv_get_name(lvl->lv); attrs = lvm_lv_get_attr(lvl->lv); -- 2.30.2