]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Add NULL check for pmksa cache free_cb() callback
authorVinay Gannevaram <quic_vganneva@quicinc.com>
Wed, 11 Oct 2023 11:02:23 +0000 (16:32 +0530)
committerJouni Malinen <j@w1.fi>
Thu, 26 Oct 2023 12:46:17 +0000 (15:46 +0300)
free_cb can be NULL during the pmksa_cache_auth_init() from the modules
using libpasn.so. So check it explicitly before dereferencing.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
src/ap/pmksa_cache_auth.c

index 32d291d1c0560f4eee274ed29d4a4374736093c2..891c16b6458551e9b8426ed41643b88da9de91c6 100644 (file)
@@ -56,7 +56,9 @@ void pmksa_cache_free_entry(struct rsn_pmksa_cache *pmksa,
        unsigned int hash;
 
        pmksa->pmksa_count--;
-       pmksa->free_cb(entry, pmksa->ctx);
+
+       if (pmksa->free_cb)
+               pmksa->free_cb(entry, pmksa->ctx);
 
        /* unlink from hash list */
        hash = PMKID_HASH(entry->pmkid);