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:
harti 2005-05-25 16:06:14 +00:00
parent b1db94ccb3
commit ec3ee28e7c

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;