summaryrefslogtreecommitdiff
path: root/src/conf-parser.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2010-08-12 01:01:30 +0200
committerLennart Poettering <lennart@poettering.net>2010-08-12 01:01:30 +0200
commit449648c430b38906fd8c8cd9cc3e4a5d05d7e0a9 (patch)
tree664bad3e69b3d01f110ac499e5786d8f0a3a225e /src/conf-parser.c
parentafea26ad7d406d8b6c95d2642cb5a1d807b87546 (diff)
conf-parser: don't crash if an assignment is read before a section header
Diffstat (limited to 'src/conf-parser.c')
-rw-r--r--src/conf-parser.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/conf-parser.c b/src/conf-parser.c
index 1cabc0d789..b439d0ce7c 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, '='))) {