mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-21 16:55:33 +00:00
wpa_supplicant: Fix invalid memory dereference
This commit is contained in:
@@ -413,7 +413,8 @@ int eap_sm_process_request(struct eap_sm *sm, struct wpabuf *reqData)
|
||||
return ESP_FAIL;
|
||||
}
|
||||
|
||||
if (ehdr->identifier == sm->current_identifier) {
|
||||
if (ehdr->identifier == sm->current_identifier &&
|
||||
sm->lastRespData != NULL) {
|
||||
/*Retransmit*/
|
||||
resp = sm->lastRespData;
|
||||
goto send_resp;
|
||||
@@ -494,7 +495,10 @@ build_nak:
|
||||
send_resp:
|
||||
if (resp == NULL) {
|
||||
wpa_printf(MSG_ERROR, "Response build fail, return.");
|
||||
return ESP_FAIL;
|
||||
wpabuf_free(sm->lastRespData);
|
||||
sm->lastRespData = resp;
|
||||
wpa2_set_eap_state(WPA2_ENT_EAP_STATE_FAIL);
|
||||
return WPA2_ENT_EAP_STATE_FAIL;
|
||||
}
|
||||
ret = eap_sm_send_eapol(sm, resp);
|
||||
if (resp != sm->lastRespData) {
|
||||
|
Reference in New Issue
Block a user