mirror of
https://github.com/espressif/esp-idf.git
synced 2025-07-30 10:47:19 +02: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:
@ -321,6 +321,14 @@ fail:
|
|||||||
return -1;
|
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)
|
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);
|
wps_registrar_deinit(hapd->wps->registrar);
|
||||||
hapd->wps->registrar = NULL;
|
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();
|
eap_server_unregister_methods();
|
||||||
hapd->wps = NULL;
|
hapd->wps = NULL;
|
||||||
hostapd_wps_clear_ies(hapd, 1);
|
hostapd_wps_clear_ies(hapd, 1);
|
||||||
|
Reference in New Issue
Block a user