From 32360ad498202301c2c47ae2071f9938acb7c797 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Wed, 27 Jan 2021 00:09:49 +0200 Subject: [PATCH] wlantest: Fix broadcast EAPOL-Key frame handling This resulted in an attempt to dereference a NULL pointer since sta_addr is not known in this type of a case. Signed-off-by: Jouni Malinen --- wlantest/rx_eapol.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/wlantest/rx_eapol.c b/wlantest/rx_eapol.c index eaf97c3e8..d5e10debf 100644 --- a/wlantest/rx_eapol.c +++ b/wlantest/rx_eapol.c @@ -1056,7 +1056,10 @@ static void rx_data_eapol_key(struct wlantest *wt, const u8 *bssid, bss = bss_get(wt, bssid); if (bss) { - sta = sta_get(bss, sta_addr); + if (sta_addr) + sta = sta_get(bss, sta_addr); + else + sta = NULL; if (sta) mic_len = wpa_mic_len(sta->key_mgmt, PMK_LEN); }