From eccca0a6b0121f4811830a238aaffb1797c5063c Mon Sep 17 00:00:00 2001 From: Sajia Date: Sun, 29 Sep 2024 18:30:30 +0530 Subject: [PATCH] fix(wifi): Add a check on hostapd instance while handling an Auth frame --- components/wpa_supplicant/esp_supplicant/src/esp_wpa3.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/components/wpa_supplicant/esp_supplicant/src/esp_wpa3.c b/components/wpa_supplicant/esp_supplicant/src/esp_wpa3.c index 3aa198994f..c0c23bf6de 100644 --- a/components/wpa_supplicant/esp_supplicant/src/esp_wpa3.c +++ b/components/wpa_supplicant/esp_supplicant/src/esp_wpa3.c @@ -583,6 +583,9 @@ bool wpa3_hostap_auth_deinit(void) static int wpa3_hostap_handle_auth(u8 *buf, size_t len, u32 auth_transaction, u16 status, u8 *bssid) { struct hostapd_data *hapd = (struct hostapd_data *)esp_wifi_get_hostap_private_internal(); + if (!hapd) { + return ESP_FAIL; + } struct sta_info *sta = ap_get_sta(hapd, bssid); if (auth_transaction == SAE_MSG_COMMIT) { if (sta && sta->sae_commit_processing) {