From: Lennart Poettering Date: Wed, 11 Aug 2010 23:01:30 +0000 (+0200) Subject: conf-parser: don't crash if an assignment is read before a section header X-Git-Tag: v8~115 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=commitdiff_plain;h=449648c430b38906fd8c8cd9cc3e4a5d05d7e0a9;hp=afea26ad7d406d8b6c95d2642cb5a1d807b87546 conf-parser: don't crash if an assignment is read before a section header --- 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, '='))) {