Skip to content

Commit fb75c85

Browse files
committed
Merge branch 'bugfix/pmksa_null_check' into 'master'
Draft: fix(wifi): Fix crash when set config is called with changed password Closes IDFGH-14863 and IDFGH-14926 Closes #15635 See merge request espressif/esp-idf!37840
2 parents 253b0e1 + 437fa9a commit fb75c85

File tree

1 file changed

+5
-1
lines changed
  • components/wpa_supplicant/src/rsn_supp

1 file changed

+5
-1
lines changed

components/wpa_supplicant/src/rsn_supp/wpa.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2167,11 +2167,13 @@ void wpa_sm_deinit(void)
21672167
{
21682168
struct wpa_sm *sm = &gWpaSm;
21692169
pmksa_cache_deinit(sm->pmksa);
2170+
sm->pmksa = NULL;
21702171
os_free(sm->ap_rsnxe);
21712172
sm->ap_rsnxe = NULL;
21722173
os_free(sm->assoc_rsnxe);
21732174
wpa_sm_drop_sa(sm);
21742175
sm->assoc_rsnxe = NULL;
2176+
memset(sm, 0, sizeof(*sm));
21752177
}
21762178

21772179

@@ -3014,6 +3016,8 @@ int owe_process_assoc_resp(const u8 *rsn_ie, size_t rsn_len, const uint8_t *dh_i
30143016

30153017
void wpa_sm_pmksa_cache_flush(struct wpa_sm *sm, void *network_ctx)
30163018
{
3017-
pmksa_cache_flush(sm->pmksa, network_ctx, NULL, 0);
3019+
if (sm->pmksa) {
3020+
pmksa_cache_flush(sm->pmksa, network_ctx, NULL, 0);
3021+
}
30183022
}
30193023
#endif // ESP_SUPPLICANT

0 commit comments

Comments
 (0)