From fba65bff16fd5decaa80df08938873725cbdfe45 Mon Sep 17 00:00:00 2001 From: Pieter Lexis Date: Thu, 9 Nov 2017 11:09:32 +0100 Subject: [PATCH] Check return value of getTSIGKey and B64Decode This would lead to crashes if the TSIG key was referenced in TSIG-ALLOW-FROM but the key was not in the tsigkeys table. Closes #5931 --- pdns/mastercommunicator.cc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/pdns/mastercommunicator.cc b/pdns/mastercommunicator.cc index 667cb7648..456957a80 100644 --- a/pdns/mastercommunicator.cc +++ b/pdns/mastercommunicator.cc @@ -238,7 +238,10 @@ void CommunicatorClass::sendNotification(int sock, const DNSName& domain, const pw.getHeader()->aa = true; if (tsigkeyname.empty() == false) { - B.getTSIGKey(tsigkeyname, &tsigalgorithm, &tsigsecret64); + if (!B.getTSIGKey(tsigkeyname, &tsigalgorithm, &tsigsecret64)) { + L<