aboutsummaryrefslogtreecommitdiffstats
path: root/package/network/services/hostapd/patches/170-DPP-fix-memleak-of-intro.peer_key.patch
blob: 157347d6d76f066ec5dc26fb4efafe63d6d767ed (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
From 639bb1bb912029ec4ff110c3ed807b62f583d6bf Mon Sep 17 00:00:00 2001
From: Glenn Strauss <gstrauss@gluelogic.com>
Date: Sun, 9 Oct 2022 04:02:44 -0400
Subject: [PATCH 7/7] DPP: fix memleak of intro.peer_key

fix memleak of intro.peer_key in wpas_dpp_rx_peer_disc_resp()

Signed-off-by: Glenn Strauss <gstrauss@gluelogic.com>
---
 wpa_supplicant/dpp_supplicant.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

--- a/wpa_supplicant/dpp_supplicant.c
+++ b/wpa_supplicant/dpp_supplicant.c
@@ -2610,6 +2610,8 @@ static void wpas_dpp_rx_peer_disc_resp(s
 		return;
 	}
 
+	os_memset(&intro, 0, sizeof(intro));
+
 	trans_id = dpp_get_attr(buf, len, DPP_ATTR_TRANSACTION_ID,
 			       &trans_id_len);
 	if (!trans_id || trans_id_len != 1) {
@@ -2720,7 +2722,7 @@ static void wpas_dpp_rx_peer_disc_resp(s
 		wpa_supplicant_req_scan(wpa_s, 0, 0);
 	}
 fail:
-	os_memset(&intro, 0, sizeof(intro));
+	dpp_peer_intro_deinit(&intro);
 }