]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
ERP server: Make erp_send_finish_reauth() easier for static analyzers
authorJouni Malinen <j@w1.fi>
Tue, 23 Jun 2015 15:25:35 +0000 (18:25 +0300)
committerJouni Malinen <j@w1.fi>
Tue, 23 Jun 2015 15:27:06 +0000 (18:27 +0300)
The flags argument is used to indicate a failure case (0x80) which
allows erp == NULL. This may be a bit too difficult combination for
static analyzers to understand, so add an explicit check for !erp as
another condition for returning from the function before the erp pointer
gets dereferenced without checking it.

Signed-off-by: Jouni Malinen <j@w1.fi>
src/eap_server/eap_server.c

index 1f38d78b25db3d0f3740203ee7f19a31a729735a..6651229cecedd2be9bcfa96f45ed432b3d0e6497 100644 (file)
@@ -745,7 +745,7 @@ static void erp_send_finish_reauth(struct eap_sm *sm,
        wpabuf_free(sm->lastReqData);
        sm->lastReqData = NULL;
 
-       if (flags & 0x80) {
+       if ((flags & 0x80) || !erp) {
                sm->eap_if.eapFail = TRUE;
                wpa_msg(sm->msg_ctx, MSG_INFO, WPA_EVENT_EAP_FAILURE
                        MACSTR, MAC2STR(sm->peer_addr));