Module Name:    src
Committed By:   rillig
Date:           Fri Nov  6 20:59:52 UTC 2020

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

Log Message:
make(1): fix wrong condition in mkTempFile (since 2020-10-31)

The wrong negation had been added in main.c 1.414 from 2020-10-31.
Found by GCC 10, which complained about a potential null pointer
dereference in line 2188.


To generate a diff of this commit:
cvs rdiff -u -r1.426 -r1.427 src/usr.bin/make/main.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/main.c
diff -u src/usr.bin/make/main.c:1.426 src/usr.bin/make/main.c:1.427
--- src/usr.bin/make/main.c:1.426	Thu Nov  5 17:27:16 2020
+++ src/usr.bin/make/main.c	Fri Nov  6 20:59:52 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: main.c,v 1.426 2020/11/05 17:27:16 rillig Exp $	*/
+/*	$NetBSD: main.c,v 1.427 2020/11/06 20:59:52 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -118,7 +118,7 @@
 #include "trace.h"
 
 /*	"@(#)main.c	8.3 (Berkeley) 3/19/94"	*/
-MAKE_RCSID("$NetBSD: main.c,v 1.426 2020/11/05 17:27:16 rillig Exp $");
+MAKE_RCSID("$NetBSD: main.c,v 1.427 2020/11/06 20:59:52 rillig Exp $");
 #if defined(MAKE_NATIVE) && !defined(lint)
 __COPYRIGHT("@(#) Copyright (c) 1988, 1989, 1990, 1993 "
 	    "The Regents of the University of California.  "
@@ -2181,7 +2181,7 @@ mkTempFile(const char *pattern, char **o
     char tfile[MAXPATHLEN];
     int fd;
 
-    if (pattern != NULL)
+    if (pattern == NULL)h
 	pattern = TMPPAT;
     if (tmpdir == NULL)
 	tmpdir = getTmpdir();

Reply via email to