From e5dd11b09040a9e5b4db83ac0f6852a480ac07ab Mon Sep 17 00:00:00 2001 From: Ron Pedde Date: Mon, 27 Feb 2006 23:39:11 +0000 Subject: [PATCH] fix errors when using a null default in conf_get_string --- src/conf.c | 5 +++++ src/conf.h | 1 + src/main.c | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/conf.c b/src/conf.c index 4100ac88..de2a994d 100644 --- a/src/conf.c +++ b/src/conf.c @@ -395,6 +395,11 @@ int conf_get_string(char *section, char *key, char *dflt, char *out, int *size) result = pitem->value.as_string; } + if(!result) { + _conf_unlock(); + return CONF_E_NOTFOUND; + } + len = (int) strlen(result) + 1; if(len <= *size) { diff --git a/src/conf.h b/src/conf.h index b78ffd2b..47fb90c4 100644 --- a/src/conf.h +++ b/src/conf.h @@ -29,6 +29,7 @@ #define CONF_E_PARSE 4 #define CONF_E_OVERFLOW 5 /**