From: Michael Tremer Date: Mon, 14 Jun 2021 09:51:57 +0000 (+0000) Subject: config: Treat NULL as an empty section X-Git-Tag: 0.9.28~1265 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b4930fc0ea3385eb3503e7ba40ee90217d895524;p=pakfire.git config: Treat NULL as an empty section Signed-off-by: Michael Tremer --- diff --git a/src/libpakfire/config.c b/src/libpakfire/config.c index 5504aa626..b2df62df7 100644 --- a/src/libpakfire/config.c +++ b/src/libpakfire/config.c @@ -127,8 +127,14 @@ static struct pakfire_config_entry* pakfire_config_find(struct pakfire_config* c struct pakfire_config_entry* entry; // Check for valid input - if (!section || !key) + if (!key) { + errno = EINVAL; return NULL; + } + + // Treat NULL as an empty section + if (!section) + section = ""; STAILQ_FOREACH(entry, &config->entries, nodes) { // Section must match