]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Check if logconfig is NULL before using it in isc_log_doit()
authorAram Sargsyan <aram@isc.org>
Tue, 13 Aug 2024 09:45:26 +0000 (09:45 +0000)
committerArаm Sаrgsyаn <aram@isc.org>
Thu, 15 Aug 2024 12:54:37 +0000 (12:54 +0000)
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

index 53785df3c632bd85deac730720bfdfaff8856ebe..40bb7fbb3292fc3249cb0c9faaeb95932cdaa14c 100644 (file)
@@ -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]);