mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
fix(wifi): Avoid dereferencing a dangling function pointer in WPS supplicant
Avoid dereferencing a dangling function pointer in 'eap_server_sm_deinit()'. This issue arises when hostap unregisteres EAP methods before it removes the server state machine for station.
This commit is contained in:
parent
7d16878564
commit
e1502fb99e
@ -321,6 +321,14 @@ fail:
|
||||
return -1;
|
||||
}
|
||||
|
||||
#ifdef ESP_SUPPLICANT
|
||||
static int ap_sta_server_sm_deinit(struct hostapd_data *hapd,
|
||||
struct sta_info *sta, void *ctx)
|
||||
{
|
||||
ieee802_1x_free_station(hapd, sta);
|
||||
return 0;
|
||||
}
|
||||
#endif /* ESP_SUPPLICANT */
|
||||
|
||||
void hostapd_deinit_wps(struct hostapd_data *hapd)
|
||||
{
|
||||
@ -332,6 +340,11 @@ void hostapd_deinit_wps(struct hostapd_data *hapd)
|
||||
}
|
||||
wps_registrar_deinit(hapd->wps->registrar);
|
||||
hapd->wps->registrar = NULL;
|
||||
|
||||
#ifdef ESP_SUPPLICANT
|
||||
ap_for_each_sta(hapd, ap_sta_server_sm_deinit, NULL);
|
||||
#endif /* ESP_SUPPLICANT */
|
||||
|
||||
eap_server_unregister_methods();
|
||||
hapd->wps = NULL;
|
||||
hostapd_wps_clear_ies(hapd, 1);
|
||||
|
Loading…
x
Reference in New Issue
Block a user