From 62465eae361c0bacba8e8181819a7f5f27142200 Mon Sep 17 00:00:00 2001 From: Ted Unangst Date: Sun, 19 Oct 2003 20:23:35 +0000 Subject: out of bounds. report by david@. ok espie@ --- usr.bin/make/cmd_exec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'usr.bin') 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'; -- cgit v1.2.3