From 0eabc7bf8f6b81ec5b97c81434f52ce95dedb7df Mon Sep 17 00:00:00 2001 From: Hartmut Brandt Date: Wed, 25 May 2005 16:06:14 +0000 Subject: [PATCH] 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. --- usr.bin/make/cond.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.bin/make/cond.c b/usr.bin/make/cond.c index 1066ae471e27..6e7a09451778 100644 --- a/usr.bin/make/cond.c +++ b/usr.bin/make/cond.c @@ -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;