From 656e04f48ac16cc17ee9620492308fac0a38c903 Mon Sep 17 00:00:00 2001 From: Aram Sargsyan Date: Tue, 13 Aug 2024 09:45:26 +0000 Subject: [PATCH] Check if logconfig is NULL before using it in isc_log_doit() Check if 'lctx->logconfig' is NULL before using it in isc_log_doit(), because it's possible that isc_log_destroy() was already called, e.g. when a 'call_rcu' function wants to log a message during shutdown. --- lib/isc/log.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/isc/log.c b/lib/isc/log.c index 53785df3c6..40bb7fbb32 100644 --- a/lib/isc/log.c +++ b/lib/isc/log.c @@ -1511,6 +1511,9 @@ isc_log_doit(isc_log_t *lctx, isc_logcategory_t *category, lctx->buffer[0] = '\0'; isc_logconfig_t *lcfg = rcu_dereference(lctx->logconfig); + if (lcfg == NULL) { + goto unlock; + } category_channels = ISC_LIST_HEAD(lcfg->channellists[category->id]);