summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorTed Unangst <tedu@cvs.openbsd.org>2003-10-19 20:23:35 +0000
committerTed Unangst <tedu@cvs.openbsd.org>2003-10-19 20:23:35 +0000
commit62465eae361c0bacba8e8181819a7f5f27142200 (patch)
treefa0dac34f89951a0ca1df9ecb2967dee0c1b6dba /usr.bin
parent54364e0821fb0b1dad5bf54992709ecc9f08d8b1 (diff)
out of bounds. report by david@. ok espie@
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/make/cmd_exec.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/make/cmd_exec.c b/usr.bin/make/cmd_exec.c
index 2a65e0c384d..ea7e3d8072c 100644
--- a/usr.bin/make/cmd_exec.c
+++ b/usr.bin/make/cmd_exec.c
@@ -1,5 +1,5 @@
/* $OpenPackages$ */
-/* $OpenBSD: cmd_exec.c,v 1.3 2002/08/05 17:04:36 millert Exp $ */
+/* $OpenBSD: cmd_exec.c,v 1.4 2003/10/19 20:23:34 tedu Exp $ */
/*
* Copyright (c) 2001 Marc Espie.
*
@@ -126,7 +126,7 @@ Cmd_Exec(cmd, err)
/* The result is null terminated, Convert newlines to spaces. */
cp = result + length - 1;
- if (*cp == '\n')
+ if (cp >= result && *cp == '\n')
/* A final newline is just stripped. */
*cp-- = '\0';