9
0
Fork 0

blspec: Do not crash on config files without newline on last line

When the last line in a config file has no newline then 'next' is NULL
on the the loop iteration. Check that before derefencing 'next'.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
Sascha Hauer 2016-02-11 15:57:24 +01:00
parent 0fe011b6ff
commit 0aae1dc98c
1 changed files with 1 additions and 1 deletions

View File

@ -75,7 +75,7 @@ static struct blspec_entry *blspec_entry_open(struct blspec *blspec,
next = buf;
while (*next) {
while (next && *next) {
char *name, *val;
line = next;