]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Fix hostapd PMKSA_ADD with Authenticator disabled
authorJouni Malinen <j@w1.fi>
Sun, 7 Mar 2021 10:33:30 +0000 (12:33 +0200)
committerJouni Malinen <j@w1.fi>
Sun, 7 Mar 2021 10:33:30 +0000 (12:33 +0200)
This function can get called with hapd->wpa_auth == NULL from the
control interface handler, so explicitly check for that.

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

index 7c53797e0b9ea84447d1eb7708e181990e7737b2..6c791e26b0b758c9652e699b61b145f9cc448a1d 100644 (file)
@@ -4831,7 +4831,7 @@ int wpa_auth_pmksa_add2(struct wpa_authenticator *wpa_auth, const u8 *addr,
                        const u8 *pmk, size_t pmk_len, const u8 *pmkid,
                        int session_timeout, int akmp)
 {
-       if (wpa_auth->conf.disable_pmksa_caching)
+       if (!wpa_auth || wpa_auth->conf.disable_pmksa_caching)
                return -1;
 
        wpa_hexdump_key(MSG_DEBUG, "RSN: Cache PMK (2)", pmk, PMK_LEN);