From af914569491c47685d1d352082b4ad6ef1d96f9b Mon Sep 17 00:00:00 2001 From: Alasdair Kergon Date: Thu, 8 Mar 2007 19:22:52 +0000 Subject: [PATCH] Fix two more segfaults if an empty config file section encountered. --- WHATS_NEW | 1 + lib/config/config.c | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/WHATS_NEW b/WHATS_NEW index 639b936b2..a3f736292 100644 --- a/WHATS_NEW +++ b/WHATS_NEW @@ -1,5 +1,6 @@ Version 2.02.23 - ==================================== + Fix two more segfaults if an empty config file section encountered. Move .cache file into a new /etc/lvm/cache directory by default. Add devices/cache_dir & devices/cache_file_prefix, deprecating devices/cache. Create directory in fcntl_lock_file() if required. diff --git a/lib/config/config.c b/lib/config/config.c index 8997003ca..159e74106 100644 --- a/lib/config/config.c +++ b/lib/config/config.c @@ -878,7 +878,7 @@ static int _find_config_int(const struct config_node *cn1, { const struct config_node *n = _find_first_config_node(cn1, cn2, path); - if (n && n->v->type == CFG_INT) { + if (n && n->v && n->v->type == CFG_INT) { log_very_verbose("Setting %s to %d", path, n->v->v.i); return n->v->v.i; } @@ -899,7 +899,7 @@ static float _find_config_float(const struct config_node *cn1, { const struct config_node *n = _find_first_config_node(cn1, cn2, path); - if (n && n->v->type == CFG_FLOAT) { + if (n && n->v && n->v->type == CFG_FLOAT) { log_very_verbose("Setting %s to %f", path, n->v->v.r); return n->v->v.r; }