From 449648c430b38906fd8c8cd9cc3e4a5d05d7e0a9 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Thu, 12 Aug 2010 01:01:30 +0200 Subject: [PATCH 1/1] conf-parser: don't crash if an assignment is read before a section header --- src/conf-parser.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/conf-parser.c b/src/conf-parser.c index 1cabc0d78..b439d0ce7 100644 --- a/src/conf-parser.c +++ b/src/conf-parser.c @@ -122,7 +122,7 @@ static int parse_line(const char *filename, unsigned line, char **section, const return 0; } - if (sections && !strv_contains((char**) sections, *section)) + if (sections && (!*section || !strv_contains((char**) sections, *section))) return 0; if (!(e = strchr(l, '='))) { -- 2.30.2