From: Aram Sargsyan Date: Tue, 13 Aug 2024 09:45:26 +0000 (+0000) Subject: Check if logconfig is NULL before using it in isc_log_doit() X-Git-Tag: v9.21.1~45^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=656e04f48ac16cc17ee9620492308fac0a38c903;p=thirdparty%2Fbind9.git 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. --- diff --git a/lib/isc/log.c b/lib/isc/log.c index 53785df3c63..40bb7fbb329 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]);