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): actually fix the use-after-free bug an...



details:   https://anonhg.NetBSD.org/src/rev/7ac40f644076
branches:  trunk
changeset: 957692:7ac40f644076
user:      rillig <rillig%NetBSD.org@localhost>
date:      Mon Dec 07 01:27:08 2020 +0000

description:
make(1): actually fix the use-after-free bug and the double-free

The use-after-free bug had been there since 2020-11-22, the double-free
bug since a few minutes.

diffstat:

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

diffs (26 lines):

diff -r 687f1f2f43d2 -r 7ac40f644076 usr.bin/make/suff.c
--- a/usr.bin/make/suff.c       Mon Dec 07 01:24:41 2020 +0000
+++ b/usr.bin/make/suff.c       Mon Dec 07 01:27:08 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: suff.c,v 1.328 2020/12/07 01:24:41 rillig Exp $        */
+/*     $NetBSD: suff.c,v 1.329 2020/12/07 01:27:08 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.328 2020/12/07 01:24:41 rillig Exp $");
+MAKE_RCSID("$NetBSD: suff.c,v 1.329 2020/12/07 01:27:08 rillig Exp $");
 
 typedef List SuffixList;
 typedef ListNode SuffixListNode;
@@ -1068,7 +1068,6 @@
                Candidate *src = ln->datum;
 
                if (src->numChildren == 0) {
-                       free(src->file);
                        if (src->parent == NULL)
                                free(src->prefix);
                        else {



Home | Main Index | Thread Index | Old Index