diff options
author | Jeremy Kerr <jk@ozlabs.org> | 2013-05-10 12:01:06 +0800 |
---|---|---|
committer | Jeremy Kerr <jk@ozlabs.org> | 2013-05-15 14:37:49 +0800 |
commit | 07bf13167aacf49a694aea3341caa15379916bec (patch) | |
tree | 380460f2bf9ca77e655a87d6903559ed36943f8f /discover/parser-conf.c | |
parent | 7c8683fa009115f8a3b08b7a7666b64ebcbbc1bc (diff) | |
download | petitboot-07bf13167aacf49a694aea3341caa15379916bec.zip petitboot-07bf13167aacf49a694aea3341caa15379916bec.tar.gz |
discover: Don't access bytes before the start of empty strings
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Diffstat (limited to 'discover/parser-conf.c')
-rw-r--r-- | discover/parser-conf.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/discover/parser-conf.c b/discover/parser-conf.c index 94612c3..4bd2387 100644 --- a/discover/parser-conf.c +++ b/discover/parser-conf.c @@ -46,6 +46,9 @@ char *conf_strip_str(char *s) if (!s) return NULL; + if (!strlen(s)) + return NULL; + while (*s == '"' || *s == '\'' || isspace(*s)) s++; |