Module Name:    src
Committed By:   sjg
Date:           Wed Mar 18 23:53:02 UTC 2020

Modified Files:
        src/usr.bin/make: meta.c

Log Message:
Check for meta file corruption earlier and more often.


To generate a diff of this commit:
cvs rdiff -u -r1.79 -r1.80 src/usr.bin/make/meta.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/make/meta.c
diff -u src/usr.bin/make/meta.c:1.79 src/usr.bin/make/meta.c:1.80
--- src/usr.bin/make/meta.c:1.79	Wed Feb 12 16:50:37 2020
+++ src/usr.bin/make/meta.c	Wed Mar 18 23:53:02 2020
@@ -1,4 +1,4 @@
-/*      $NetBSD: meta.c,v 1.79 2020/02/12 16:50:37 sjg Exp $ */
+/*      $NetBSD: meta.c,v 1.80 2020/03/18 23:53:02 sjg Exp $ */
 
 /*
  * Implement 'meta' mode.
@@ -1558,6 +1558,7 @@ meta_oodate(GNode *gn, Boolean oodate)
 			if (buf[x - 1] == '\n')
 			    buf[x - 1] = '\0';
 		    }
+		    CHECK_VALID_META(p);
 		    if (!hasOODATE &&
 			!(gn->type & OP_NOMETA_CMP) &&
 			strcmp(p, cmd) != 0) {
@@ -1579,6 +1580,7 @@ meta_oodate(GNode *gn, Boolean oodate)
 			fprintf(debug_file, "%s: %d: there are extra build commands now that weren't in the meta data file\n", fname, lineno);
 		    oodate = TRUE;
 		}
+		CHECK_VALID_META(p);
 		if (strcmp(p, cwd) != 0) {
 		    if (DEBUG(META))
 			fprintf(debug_file, "%s: %d: the current working directory has changed from '%s' to '%s'\n", fname, lineno, p, curdir);

Reply via email to