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