230545
From 30753514ac06111da5b677fe7cdbafd696b1d620 Mon Sep 17 00:00:00 2001
230545
From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= <pemensik@redhat.com>
230545
Date: Wed, 22 Jul 2020 18:55:02 +0200
230545
Subject: [PATCH] Prevent crash on dst initialization failure
230545
230545
server might be created, but not yet fully initialized, when fatal
230545
function is called. Check both server and task before attaching
230545
exclusive task.
230545
230545
(cherry picked from commit c5e7152cf04f75d0fe00163f076f4cc3cafce259)
230545
(cherry picked from commit 35fbfaa4981333286437f26557db26863d4c5299)
230545
---
230545
 bin/named/server.c | 2 +-
230545
 1 file changed, 1 insertion(+), 1 deletion(-)
230545
230545
diff --git a/bin/named/server.c b/bin/named/server.c
230545
index 3cd8daf99e..38780ad3d7 100644
230545
--- a/bin/named/server.c
230545
+++ b/bin/named/server.c
230545
@@ -9341,7 +9341,7 @@ ns_server_destroy(ns_server_t **serverp) {
230545
 
230545
 static void
230545
 fatal(ns_server_t *server, const char *msg, isc_result_t result) {
230545
-	if (server != NULL) {
230545
+	if (server != NULL && server->task != NULL) {
230545
 		/*
230545
 		 * Prevent races between the OpenSSL on_exit registered
230545
 		 * function and any other OpenSSL calls from other tasks
230545
-- 
230545
2.26.2
230545