mirror of
https://github.com/espressif/esp-idf.git
synced 2025-07-31 19:24:33 +02:00
fix(wifi): Fix crash when set config is called with changed password
Closes https://github.com/espressif/esp-idf/issues/15584
This commit is contained in:
@@ -2167,11 +2167,13 @@ void wpa_sm_deinit(void)
|
|||||||
{
|
{
|
||||||
struct wpa_sm *sm = &gWpaSm;
|
struct wpa_sm *sm = &gWpaSm;
|
||||||
pmksa_cache_deinit(sm->pmksa);
|
pmksa_cache_deinit(sm->pmksa);
|
||||||
|
sm->pmksa = NULL;
|
||||||
os_free(sm->ap_rsnxe);
|
os_free(sm->ap_rsnxe);
|
||||||
sm->ap_rsnxe = NULL;
|
sm->ap_rsnxe = NULL;
|
||||||
os_free(sm->assoc_rsnxe);
|
os_free(sm->assoc_rsnxe);
|
||||||
wpa_sm_drop_sa(sm);
|
wpa_sm_drop_sa(sm);
|
||||||
sm->assoc_rsnxe = NULL;
|
sm->assoc_rsnxe = NULL;
|
||||||
|
memset(sm, 0, sizeof(*sm));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -2998,6 +3000,8 @@ fail:
|
|||||||
|
|
||||||
void wpa_sm_pmksa_cache_flush(struct wpa_sm *sm, void *network_ctx)
|
void wpa_sm_pmksa_cache_flush(struct wpa_sm *sm, void *network_ctx)
|
||||||
{
|
{
|
||||||
|
if (sm->pmksa) {
|
||||||
pmksa_cache_flush(sm->pmksa, network_ctx, NULL, 0);
|
pmksa_cache_flush(sm->pmksa, network_ctx, NULL, 0);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
#endif // ESP_SUPPLICANT
|
#endif // ESP_SUPPLICANT
|
||||||
|
Reference in New Issue
Block a user