Merge branch 'bugfix/pmksa_null_check_v5.3' into 'release/v5.3'

Fix crash when set config is called with changed password(release/v5.3)

See merge request espressif/esp-idf!41805
This commit is contained in:
Jiang Jiang Jian
2025-09-23 13:11:27 +08:00

View File

@@ -2179,11 +2179,13 @@ void wpa_sm_deinit(void)
{
struct wpa_sm *sm = &gWpaSm;
pmksa_cache_deinit(sm->pmksa);
sm->pmksa = NULL;
os_free(sm->ap_rsnxe);
sm->ap_rsnxe = NULL;
os_free(sm->assoc_rsnxe);
wpa_sm_drop_sa(sm);
sm->assoc_rsnxe = NULL;
memset(sm, 0, sizeof(*sm));
}
@@ -3005,6 +3007,8 @@ fail:
void wpa_sm_pmksa_cache_flush(struct wpa_sm *sm, void *network_ctx)
{
pmksa_cache_flush(sm->pmksa, network_ctx, NULL, 0);
if (sm->pmksa) {
pmksa_cache_flush(sm->pmksa, network_ctx, NULL, 0);
}
}
#endif // ESP_SUPPLICANT