Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/make Ensure Parse_IsVar does not step off the end of...



details:   https://anonhg.NetBSD.org/src/rev/11530c0d9f88
branches:  trunk
changeset: 359978:11530c0d9f88
user:      sjg <sjg%NetBSD.org@localhost>
date:      Sat Feb 05 00:37:19 2022 +0000

description:
Ensure Parse_IsVar does not step off the end of input string.

diffstat:

 usr.bin/make/parse.c |  6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diffs (27 lines):

diff -r 4e08762dca30 -r 11530c0d9f88 usr.bin/make/parse.c
--- a/usr.bin/make/parse.c      Sat Feb 05 00:26:21 2022 +0000
+++ b/usr.bin/make/parse.c      Sat Feb 05 00:37:19 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: parse.c,v 1.661 2022/02/04 23:22:19 rillig Exp $       */
+/*     $NetBSD: parse.c,v 1.662 2022/02/05 00:37:19 sjg Exp $  */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -106,7 +106,7 @@
 #include "pathnames.h"
 
 /*     "@(#)parse.c    8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: parse.c,v 1.661 2022/02/04 23:22:19 rillig Exp $");
+MAKE_RCSID("$NetBSD: parse.c,v 1.662 2022/02/05 00:37:19 sjg Exp $");
 
 /*
  * A file being read.
@@ -1574,6 +1574,8 @@
                while (ch == ' ' || ch == '\t')
                        ch = *p++;
 
+               if (ch == '\0')
+                       return false;
 #ifdef SUNSHCMD
                if (ch == ':' && p[0] == 's' && p[1] == 'h') {
                        p += 2;



Home | Main Index | Thread Index | Old Index