Commit 84af0385 authored by Leah Neukirchen's avatar Leah Neukirchen

parse_string: off-by-one for reallocation

parent cbf6ff98
......@@ -504,7 +504,7 @@ parse_string(char **s)
pos++;
while (*pos &&
(*pos != '"' || (*pos == '"' && *(pos+1) == '"'))) {
if (len >= bufsiz) {
if (len + 1 >= bufsiz) {
bufsiz = 2*bufsiz + 16;
buf = realloc(buf, bufsiz);
if (!buf)
......
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