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:
parent
0fe011b6ff
commit
0aae1dc98c
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue