From: Glenn Strauss Date: Tue, 8 Nov 2022 05:05:52 +0000 (-0500) Subject: DPP: Fix memory leak of intro.peer_key in station handling X-Git-Tag: hostap_2_11~1516 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0202b9774178685f560b1def3a568155afddf58d;p=thirdparty%2Fhostap.git DPP: Fix memory leak of intro.peer_key in station handling Fix memory leak of intro.peer_key in wpas_dpp_rx_peer_disc_resp(). The other code paths were updated to use dpp_peer_intro_deinit(), but this non-privacy-protection version of the station implementation was missed. Fixes: 148de3e0dc2a ("DPP3: Private Peer Introduction protocol") Signed-off-by: Glenn Strauss --- diff --git a/wpa_supplicant/dpp_supplicant.c b/wpa_supplicant/dpp_supplicant.c index 6d0cd27cb..917fae380 100644 --- a/wpa_supplicant/dpp_supplicant.c +++ b/wpa_supplicant/dpp_supplicant.c @@ -2624,6 +2624,8 @@ static void wpas_dpp_rx_peer_disc_resp(struct wpa_supplicant *wpa_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) { @@ -2735,7 +2737,7 @@ static void wpas_dpp_rx_peer_disc_resp(struct wpa_supplicant *wpa_s, wpa_supplicant_req_scan(wpa_s, 0, 0); } fail: - os_memset(&intro, 0, sizeof(intro)); + dpp_peer_intro_deinit(&intro); }