]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Make phase2_method initialization easier for static analyzers
authorJouni Malinen <j@w1.fi>
Sun, 13 Nov 2011 20:47:14 +0000 (22:47 +0200)
committerJouni Malinen <j@w1.fi>
Sun, 13 Nov 2011 20:47:14 +0000 (22:47 +0200)
data->phase2_method cannot really be NULL if
eap_fast_init_phase2_method() returns success, but this construction
seems to be too difficult for some static analyzers. While this change
is not really needed in practice, it makes it easier to go through
warnings from such analyzers.

Signed-hostap: Jouni Malinen <j@w1.fi>

src/eap_peer/eap_fast.c

index 8bd46786418410e3cc6cee47998f14f5cac1232f..3cfb41ab2de2121a101692ded8d54bf009233d6e 100644 (file)
@@ -444,8 +444,9 @@ static int eap_fast_phase2_request(struct eap_sm *sm,
                return 0;
        }
 
-       if (data->phase2_priv == NULL &&
-           eap_fast_init_phase2_method(sm, data) < 0) {
+       if ((data->phase2_priv == NULL &&
+            eap_fast_init_phase2_method(sm, data) < 0) ||
+           data->phase2_method == NULL) {
                wpa_printf(MSG_INFO, "EAP-FAST: Failed to initialize "
                           "Phase 2 EAP method %d", *pos);
                ret->methodState = METHOD_DONE;