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 <jouni@codeaurora.org>
This commit is contained in:
Jouni Malinen 2021-01-27 00:09:49 +02:00 committed by Jouni Malinen
parent a826ff2d95
commit 32360ad498

View file

@ -1056,7 +1056,10 @@ static void rx_data_eapol_key(struct wlantest *wt, const u8 *bssid,
bss = bss_get(wt, bssid); bss = bss_get(wt, bssid);
if (bss) { if (bss) {
if (sta_addr)
sta = sta_get(bss, sta_addr); sta = sta_get(bss, sta_addr);
else
sta = NULL;
if (sta) if (sta)
mic_len = wpa_mic_len(sta->key_mgmt, PMK_LEN); mic_len = wpa_mic_len(sta->key_mgmt, PMK_LEN);
} }