Source-Changes-HG archive

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

[src-draft/trunk]: src/sys/net80211 Set freed memory to NULL. This avoids a ...



details:   https://anonhg.NetBSD.org/src-all/rev/9b79dc8cc430
branches:  trunk
changeset: 1027129:9b79dc8cc430
user:      Nathanial Sloss <nat%netbsd.org@localhost>
date:      Sun Nov 07 13:19:20 2021 +1100

description:
Set freed memory to NULL.  This avoids a crash with ies->data.

diffstat:

 sys/net80211/ieee80211_node.c |  2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diffs (19 lines):

diff -r 3224128db1c3 -r 9b79dc8cc430 sys/net80211/ieee80211_node.c
--- a/sys/net80211/ieee80211_node.c     Tue Nov 02 17:18:28 2021 +0100
+++ b/sys/net80211/ieee80211_node.c     Sun Nov 07 13:19:20 2021 +1100
@@ -1188,6 +1188,7 @@
 {
        if (ies->data != NULL)
                IEEE80211_MFREE(ies->data, M_80211_NODE_IE, ies->len);
+       ies->data = NULL;
 }
 
 /*
@@ -1353,6 +1354,7 @@
        ieee80211_ies_cleanup(&ni->ni_ies);
        ieee80211_psq_cleanup(&ni->ni_psq);
        IEEE80211_MFREE(ni, M_80211_NODE, sizeof(*ni));
+       ni = NULL;
 }
 
 static void



Home | Main Index | Thread Index | Old Index