Under certain conditions the condition parser would go one past end of

the string. Until now this caused no harm, because the buffer code used
to tack two NULs onto buffers. With the new, soon to come, parsing code
this isn't the case anymore in all cases, so fix this.
This commit is contained in:
Hartmut Brandt 2005-05-25 16:06:14 +00:00
parent 59ddf345d5
commit 0eabc7bf8f

View File

@ -628,7 +628,7 @@ CondToken(Boolean doEval)
}
free(string);
if (rhs == condExpr) {
if (!qt && *cp == ')')
if (*cp == '\0' || (!qt && *cp == ')'))
condExpr = cp;
else
condExpr = cp + 1;