From bc69125ef0a127dfae353b7df235a0019714e0a1 Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Fri, 28 Oct 2011 20:07:38 +0000 Subject: [PATCH] Fix core on buggy config file Since fixed within unreleased version so no WHATS_NEW --- libdm/libdm-config.c | 6 +++++- test/t-000-basic.sh | 3 +++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/libdm/libdm-config.c b/libdm/libdm-config.c index 8fee4ecc7..3ece3d32a 100644 --- a/libdm/libdm-config.c +++ b/libdm/libdm-config.c @@ -170,8 +170,12 @@ void dm_config_destroy(struct dm_config_tree *cft) */ struct dm_config_tree *dm_config_remove_cascaded_tree(struct dm_config_tree *cft) { - struct dm_config_tree *second_cft = cft->cascade; + struct dm_config_tree *second_cft; + if (!cft) + return NULL; + + second_cft = cft->cascade; cft->cascade = NULL; return second_cft; diff --git a/test/t-000-basic.sh b/test/t-000-basic.sh index bd7ba693b..0b54d9524 100755 --- a/test/t-000-basic.sh +++ b/test/t-000-basic.sh @@ -23,3 +23,6 @@ diff -u actual expected # ensure we can create devices (uses dmsetup, etc) aux prepare_devs 5 +# ensure we do not crash on a bug in config file +aux lvmconf 'log/prefix = 1""' +not lvs -- 2.43.5