From 647e83a5b0e31eca32afa19be6d36d045f12647d Mon Sep 17 00:00:00 2001 From: Otto Date: Tue, 4 Jan 2022 14:22:22 +0100 Subject: [PATCH] Answer can be nullptr, so test for it to avoid null deref. --- pdns/distributor.hh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pdns/distributor.hh b/pdns/distributor.hh index 92b96b36ee..bba617cbca 100644 --- a/pdns/distributor.hh +++ b/pdns/distributor.hh @@ -249,7 +249,9 @@ retry: QD->callback(a, QD->start); #ifdef ENABLE_GSS_TSIG - QD->Q.cleanupGSS(a->d.rcode); + if (a != nullptr) { + QD->Q.cleanupGSS(a->d.rcode); + } #endif QD.reset(); } @@ -313,7 +315,9 @@ retry: } callback(a, start); #ifdef ENABLE_GSS_TSIG - q.cleanupGSS(a->d.rcode); + if (a != nullptr) { + q.cleanupGSS(a->d.rcode); + } #endif return 0; } -- 2.47.2