From de4c4c1a394b70a392aeb85ae770f2381771a428 Mon Sep 17 00:00:00 2001 From: Sebastian Harl Date: Fri, 5 Dec 2008 17:22:53 +0100 Subject: [PATCH] configfile.c: Ignore registered undefined config keys. If a registered config key equals NULL, it is now ignored. Before, this would cause a segfault. As this has happened a few times in the past, we not handle it sanely. --- src/configfile.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/configfile.c b/src/configfile.c index b1030fe9..bb57ca26 100644 --- a/src/configfile.c +++ b/src/configfile.c @@ -155,7 +155,8 @@ static int cf_dispatch (const char *type, const char *orig_key, for (i = 0; i < cf_cb->keys_num; i++) { - if (strcasecmp (cf_cb->keys[i], key) == 0) + if ((cf_cb->keys[i] != NULL) + && (strcasecmp (cf_cb->keys[i], key) == 0)) { ret = (*cf_cb->callback) (key, value); break; -- 2.30.2