[9.20] fix: dev: 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.

Closes #4842

Backport of MR !9297

Merge branch 'backport-4842-shutdown-crash-in-isc_log_doit-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!9323
This commit is contained in:
Arаm Sаrgsyаn 2024-08-15 14:27:48 +00:00
commit 11cb376725

View 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]);