Commit 5c922794 authored by Andreas Schlick's avatar Andreas Schlick Committed by Rusty Russell

ciniparser: Add a check that len remains within bounds.

If the line is made solely of whitespaces, they get removed and we end up with len
set to -1. Therefore we need an additional check to avoid dereferencing line[-1].
parent 9aa2e32a
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment