From 925f0656c1aa8da8659472bf8eeb7248653d036b Mon Sep 17 00:00:00 2001 From: Max Okumoto Date: Thu, 16 Jun 2005 22:46:48 +0000 Subject: [PATCH] FreeBSD-Date: 2005/05/25 17:06:14 Author: harti 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 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.bin/make/cond.c b/usr.bin/make/cond.c index 1847880be5..61331e6d4b 100644 --- a/usr.bin/make/cond.c +++ b/usr.bin/make/cond.c @@ -38,7 +38,7 @@ * * @(#)cond.c 8.2 (Berkeley) 1/2/94 * $FreeBSD: src/usr.bin/make/cond.c,v 1.39 2005/02/07 07:49:16 harti Exp $ - * $DragonFly: src/usr.bin/make/cond.c,v 1.45 2005/05/23 20:04:43 okumoto Exp $ + * $DragonFly: src/usr.bin/make/cond.c,v 1.46 2005/06/16 22:46:48 okumoto Exp $ */ /* @@ -629,7 +629,7 @@ CondToken(Parser *parser, Boolean doEval) } free(string); if (rhs == condExpr) { - if (!qt && *cp == ')') + if (*cp == '\0' || (!qt && *cp == ')')) condExpr = cp; else condExpr = cp + 1; -- 2.41.0