Module Name:    src
Committed By:   christos
Date:           Fri Nov 26 15:14:29 UTC 2010

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

Log Message:
check for NULL before de-referencing.


To generate a diff of this commit:
cvs rdiff -u -r1.60 -r1.61 src/usr.bin/make/arch.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/arch.c
diff -u src/usr.bin/make/arch.c:1.60 src/usr.bin/make/arch.c:1.61
--- src/usr.bin/make/arch.c:1.60	Thu Nov 25 16:31:08 2010
+++ src/usr.bin/make/arch.c	Fri Nov 26 10:14:29 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: arch.c,v 1.60 2010/11/25 21:31:08 christos Exp $	*/
+/*	$NetBSD: arch.c,v 1.61 2010/11/26 15:14:29 christos Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: arch.c,v 1.60 2010/11/25 21:31:08 christos Exp $";
+static char rcsid[] = "$NetBSD: arch.c,v 1.61 2010/11/26 15:14:29 christos Exp $";
 #else
 #include <sys/cdefs.h>
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)arch.c	8.2 (Berkeley) 1/2/94";
 #else
-__RCSID("$NetBSD: arch.c,v 1.60 2010/11/25 21:31:08 christos Exp $");
+__RCSID("$NetBSD: arch.c,v 1.61 2010/11/26 15:14:29 christos Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -1246,7 +1246,8 @@
     } else if (OP_NOP(gn->type) && Lst_IsEmpty(gn->children)) {
 	oodate = FALSE;
     } else if ((!Lst_IsEmpty(gn->children) && gn->cmgn == NULL) ||
-	       (gn->mtime > now) || (gn->mtime < gn->cmgn->mtime)) {
+	       (gn->mtime > now) ||
+	       (gn->cmgn != NULL && gn->mtime < gn->cmgn->mtime)) {
 	oodate = TRUE;
     } else {
 #ifdef RANLIBMAG

Reply via email to