summaryrefslogtreecommitdiffstats
path: root/usr.bin/make/cond.c
diff options
context:
space:
mode:
authorharti <harti@FreeBSD.org>2005-05-25 16:06:14 +0000
committerharti <harti@FreeBSD.org>2005-05-25 16:06:14 +0000
commitec3ee28e7c3d46e2aa137fac569ec65515286098 (patch)
treeb2b1face4ca4493677a90d245f867cc56872dda9 /usr.bin/make/cond.c
parentb1db94ccb3e505b2f910bcffba5eff9e77ea6b30 (diff)
downloadFreeBSD-src-ec3ee28e7c3d46e2aa137fac569ec65515286098.zip
FreeBSD-src-ec3ee28e7c3d46e2aa137fac569ec65515286098.tar.gz
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.
Diffstat (limited to 'usr.bin/make/cond.c')
-rw-r--r--usr.bin/make/cond.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/usr.bin/make/cond.c b/usr.bin/make/cond.c
index 1066ae4..6e7a094 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;
OpenPOWER on IntegriCloud