]> git.ozlabs.org Git - ccan/blobdiff - ccan/ciniparser/ciniparser.c
ciniparser: Add a check that len remains within bounds.
[ccan] / ccan / ciniparser / ciniparser.c
index d28c15817e10de530ef43e05744d56106ae0fef9..2b60e409bd7ac7259d2e5245fd457e8087ed7472 100644 (file)
@@ -423,7 +423,7 @@ dictionary *ciniparser_load(const char *ininame)
                }
 
                /* Detect multi-line */
-               if (line[len] == '\\') {
+               if (len >= 0 && line[len] == '\\') {
                        /* Multi-line value */
                        last = len;
                        continue;