From ff87b5745a94a6339b6826a0e9dc770be926fa45 Mon Sep 17 00:00:00 2001 From: Peter van Dijk Date: Wed, 11 Nov 2020 11:20:41 +0100 Subject: [PATCH] rec-4.4: do not send overly long NOD lookups --- pdns/pdns_recursor.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pdns/pdns_recursor.cc b/pdns/pdns_recursor.cc index c4f5a8a460..ed1be7ff9d 100644 --- a/pdns/pdns_recursor.cc +++ b/pdns/pdns_recursor.cc @@ -1132,7 +1132,13 @@ static void sendNODLookup(const DNSName& dname) // Send a DNS A query to .g_nodLookupDomain static const QType qt(QType::A); static const uint16_t qc(QClass::IN); - DNSName qname = dname + g_nodLookupDomain; + DNSName qname; + try { + qname = dname + g_nodLookupDomain; + } + catch(const std::range_error &e) { + return; + } vector dummy; directResolve(qname, qt, qc, dummy); } -- 2.47.2