From: Vinay Gannevaram Date: Wed, 11 Oct 2023 11:02:23 +0000 (+0530) Subject: Add NULL check for pmksa cache free_cb() callback X-Git-Tag: hostap_2_11~947 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c86064716015af06e02dbe5d1d3cfcf88b7fa45b;p=thirdparty%2Fhostap.git Add NULL check for pmksa cache free_cb() callback 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 --- diff --git a/src/ap/pmksa_cache_auth.c b/src/ap/pmksa_cache_auth.c index 32d291d1c..891c16b64 100644 --- a/src/ap/pmksa_cache_auth.c +++ b/src/ap/pmksa_cache_auth.c @@ -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);