diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2016-02-11 15:57:24 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2016-02-11 16:00:27 +0100 |
commit | 0aae1dc98cf1b0c858e630448a1ec59d69bcec9d (patch) | |
tree | db91bf6b3ab198bab751e8c9bfa77248e4b90782 | |
parent | 0fe011b6ffb4b04ae484c8c9ac5fe326f10e41c0 (diff) | |
download | barebox-0aae1dc98cf1b0c858e630448a1ec59d69bcec9d.tar.gz barebox-0aae1dc98cf1b0c858e630448a1ec59d69bcec9d.tar.xz |
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>
-rw-r--r-- | common/blspec.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/common/blspec.c b/common/blspec.c index d5ddb4fbbd..0f806cac7a 100644 --- a/common/blspec.c +++ b/common/blspec.c @@ -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; |