summaryrefslogtreecommitdiff
path: root/usr.bin/make
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2001-02-17 14:39:08 +0000
committerMarc Espie <espie@cvs.openbsd.org>2001-02-17 14:39:08 +0000
commitb190a95f49eceb540914026a617e7d7670eeb5b0 (patch)
tree898a2a5c96f9163b4728284de5793177af8cedc0 /usr.bin/make
parent0e50516f18587f40a1d0332ba0174031367ec8f0 (diff)
Guard against Var_Value() being applied to an empty string, which it
doesn't do [for efficiency reason, hash_interval does not deal with empty strings not declared as intervals. More recent incarnations of this code will use Var_Value_interval extensively instead] Problem found by Peter Stromberg.
Diffstat (limited to 'usr.bin/make')
-rw-r--r--usr.bin/make/cond.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/usr.bin/make/cond.c b/usr.bin/make/cond.c
index a3f22a64d97..45ae0af6c3c 100644
--- a/usr.bin/make/cond.c
+++ b/usr.bin/make/cond.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cond.c,v 1.22 2000/09/14 13:46:44 espie Exp $ */
+/* $OpenBSD: cond.c,v 1.23 2001/02/17 14:39:07 espie Exp $ */
/* $NetBSD: cond.c,v 1.7 1996/11/06 17:59:02 christos Exp $ */
/*
@@ -61,7 +61,7 @@
static char sccsid[] = "@(#)cond.c 8.2 (Berkeley) 1/2/94";
#else
UNUSED
-static char rcsid[] = "$OpenBSD: cond.c,v 1.22 2000/09/14 13:46:44 espie Exp $";
+static char rcsid[] = "$OpenBSD: cond.c,v 1.23 2001/02/17 14:39:07 espie Exp $";
#endif
#endif /* not lint */
@@ -292,6 +292,9 @@ CondDoDefined(argLen, arg)
char savec = arg[argLen];
Boolean result;
+ if (argLen == 0)
+ return FALSE;
+
arg[argLen] = '\0';
if (Var_Value(arg, NULL) != NULL)
result = TRUE;