]> git.ozlabs.org Git - petitboot/blobdiff - discover/parser-conf.c
discover: Don't access bytes before the start of empty strings
[petitboot] / discover / parser-conf.c
index 94612c326a6cdd35332443b1f5846878eafdd4fd..4bd23871bc6e6980c2dc3d785de0eeb3bad27a74 100644 (file)
@@ -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++;