From 17d85158cfec41511f838476f20ef1a8b59babb9 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Sun, 7 Mar 2021 12:33:30 +0200 Subject: [PATCH] Fix hostapd PMKSA_ADD with Authenticator disabled 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 --- src/ap/wpa_auth.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ap/wpa_auth.c b/src/ap/wpa_auth.c index 7c53797e0..6c791e26b 100644 --- a/src/ap/wpa_auth.c +++ b/src/ap/wpa_auth.c @@ -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);