]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
eap_proxy: Check sm != NULL more consistently
authorJouni Malinen <j@w1.fi>
Sat, 7 Jun 2014 16:26:41 +0000 (19:26 +0300)
committerJouni Malinen <j@w1.fi>
Sat, 7 Jun 2014 16:26:41 +0000 (19:26 +0300)
While it does not look like that eapol_sm_get_key() would ever be called
with sm == NULL, the current implementation is inconsistent on whether
that is allowed or not. Check sm != NULL consistently to avoid warnings
from static analyzers.

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

index 1004b1a7764d380fc528b933d54856f065a5c451..e00dea34638841909285f8a17c75f747dfeca27d 100644 (file)
@@ -1523,7 +1523,7 @@ int eapol_sm_get_key(struct eapol_sm *sm, u8 *key, size_t len)
        size_t eap_len;
 
 #ifdef CONFIG_EAP_PROXY
-       if (sm->use_eap_proxy) {
+       if (sm && sm->use_eap_proxy) {
                /* Get key from EAP proxy */
                if (sm == NULL || !eap_proxy_key_available(sm->eap_proxy)) {
                        wpa_printf(MSG_DEBUG, "EAPOL: EAP key not available");