]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
DPP: Fix memory leak of intro.peer_key in station handling
authorGlenn Strauss <gstrauss@gluelogic.com>
Tue, 8 Nov 2022 05:05:52 +0000 (00:05 -0500)
committerJouni Malinen <j@w1.fi>
Sun, 20 Nov 2022 16:04:08 +0000 (18:04 +0200)
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 <gstrauss@gluelogic.com>
wpa_supplicant/dpp_supplicant.c

index 6d0cd27cb01a9ab3eabde6545ce2de490b4ffa45..917fae3802d30344559c9ef65cf999eaca50ad6e 100644 (file)
@@ -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);
 }