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 use-after-free in -DDEBUG_SRC mode...



details:   https://anonhg.NetBSD.org/src/rev/552d9be05ffd
branches:  trunk
changeset: 1016950:552d9be05ffd
user:      rillig <rillig%NetBSD.org@localhost>
date:      Mon Dec 07 01:24:41 2020 +0000

description:
make(1): fix use-after-free in -DDEBUG_SRC mode (since 2020-11-22)

diffstat:

 usr.bin/make/suff.c |  5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diffs (26 lines):

diff -r 97357489e438 -r 552d9be05ffd usr.bin/make/suff.c
--- a/usr.bin/make/suff.c       Mon Dec 07 01:10:03 2020 +0000
+++ b/usr.bin/make/suff.c       Mon Dec 07 01:24:41 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: suff.c,v 1.327 2020/12/06 10:49:02 rillig Exp $        */
+/*     $NetBSD: suff.c,v 1.328 2020/12/07 01:24:41 rillig Exp $        */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -114,7 +114,7 @@
 #include "dir.h"
 
 /*     "@(#)suff.c     8.4 (Berkeley) 3/21/94" */
-MAKE_RCSID("$NetBSD: suff.c,v 1.327 2020/12/06 10:49:02 rillig Exp $");
+MAKE_RCSID("$NetBSD: suff.c,v 1.328 2020/12/07 01:24:41 rillig Exp $");
 
 typedef List SuffixList;
 typedef ListNode SuffixListNode;
@@ -1089,6 +1089,7 @@
                        Lst_Done(&src->childrenList);
 #endif
                        Lst_Remove(srcs, ln);
+                       free(src->file);
                        free(src);
                        return TRUE;
                }



Home | Main Index | Thread Index | Old Index