]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
wlantest: Fix broadcast EAPOL-Key frame handling
authorJouni Malinen <jouni@codeaurora.org>
Tue, 26 Jan 2021 22:09:49 +0000 (00:09 +0200)
committerJouni Malinen <j@w1.fi>
Sat, 27 Feb 2021 18:27:06 +0000 (20:27 +0200)
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 <jouni@codeaurora.org>
wlantest/rx_eapol.c

index eaf97c3e81b7b2a193a0399dd4a02a9f2d6005bc..d5e10debf3e07e8e1f4290c7122a5ddebc9baa4b 100644 (file)
@@ -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);
        }