]> git.ozlabs.org Git - petitboot/commitdiff
discover: Don't access bytes before the start of empty strings
authorJeremy Kerr <jk@ozlabs.org>
Fri, 10 May 2013 04:01:06 +0000 (12:01 +0800)
committerJeremy Kerr <jk@ozlabs.org>
Wed, 15 May 2013 06:37:49 +0000 (14:37 +0800)
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
discover/parser-conf.c

index 94612c326a6cdd35332443b1f5846878eafdd4fd..4bd23871bc6e6980c2dc3d785de0eeb3bad27a74 100644 (file)
@@ -46,6 +46,9 @@ char *conf_strip_str(char *s)
        if (!s)
                return NULL;
 
        if (!s)
                return NULL;
 
+       if (!strlen(s))
+               return NULL;
+
        while (*s == '"' || *s == '\'' || isspace(*s))
                s++;
 
        while (*s == '"' || *s == '\'' || isspace(*s))
                s++;