Make sure that EAP callbacks are not done if state machine has been removed

It is possible to get a response for a pending EAP callback after the
EAP state machine has already completed its work or has timed out. For
those cases, make sure that the callback function is not delivered since
it could result in NULL pointer dereferences.
This commit is contained in:
Jouni Malinen 2011-08-12 11:56:44 +03:00 committed by Jouni Malinen
parent 167dc97501
commit de6e463f57

View file

@ -1017,7 +1017,7 @@ static struct eapol_callbacks eapol_cb =
int eapol_auth_eap_pending_cb(struct eapol_state_machine *sm, void *ctx) int eapol_auth_eap_pending_cb(struct eapol_state_machine *sm, void *ctx)
{ {
if (sm == NULL || ctx != sm->eap) if (sm == NULL || ctx == NULL || ctx != sm->eap)
return -1; return -1;
eap_sm_pending_cb(sm->eap); eap_sm_pending_cb(sm->eap);