From c86064716015af06e02dbe5d1d3cfcf88b7fa45b Mon Sep 17 00:00:00 2001 From: Vinay Gannevaram Date: Wed, 11 Oct 2023 16:32:23 +0530 Subject: [PATCH] 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 --- src/ap/pmksa_cache_auth.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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); -- 2.47.2