Source-Changes-HG archive

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

[src/trunk]: src/usr.bin/make check for NULL before de-referencing.



details:   https://anonhg.NetBSD.org/src/rev/45b73e8a5147
branches:  trunk
changeset: 759051:45b73e8a5147
user:      christos <christos%NetBSD.org@localhost>
date:      Fri Nov 26 15:14:29 2010 +0000

description:
check for NULL before de-referencing.

diffstat:

 usr.bin/make/arch.c |  9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diffs (36 lines):

diff -r db97ccb09c8f -r 45b73e8a5147 usr.bin/make/arch.c
--- a/usr.bin/make/arch.c       Fri Nov 26 14:37:08 2010 +0000
+++ b/usr.bin/make/arch.c       Fri Nov 26 15:14:29 2010 +0000
@@ -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



Home | Main Index | Thread Index | Old Index