Source-Changes-HG archive

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

[src/trunk]: src/usr.bin/make make(1): fix wrong condition in mkTempFile (sin...



details:   https://anonhg.NetBSD.org/src/rev/b1e0cdecaff4
branches:  trunk
changeset: 956727:b1e0cdecaff4
user:      rillig <rillig%NetBSD.org@localhost>
date:      Fri Nov 06 20:59:52 2020 +0000

description:
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.

diffstat:

 usr.bin/make/main.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r f258c46ec847 -r b1e0cdecaff4 usr.bin/make/main.c
--- a/usr.bin/make/main.c       Fri Nov 06 20:50:48 2020 +0000
+++ b/usr.bin/make/main.c       Fri Nov 06 20:59:52 2020 +0000
@@ -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 @@
     char tfile[MAXPATHLEN];
     int fd;
 
-    if (pattern != NULL)
+    if (pattern == NULL)h
        pattern = TMPPAT;
     if (tmpdir == NULL)
        tmpdir = getTmpdir();



Home | Main Index | Thread Index | Old Index