From: Kees Monshouwer Date: Fri, 7 Jan 2022 23:29:38 +0000 (+0100) Subject: auth: lmdb, check if the lookup name is part of the zone X-Git-Tag: auth-4.7.0-alpha1~88^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F11152%2Fhead;p=thirdparty%2Fpdns.git auth: lmdb, check if the lookup name is part of the zone --- diff --git a/modules/lmdbbackend/lmdbbackend.cc b/modules/lmdbbackend/lmdbbackend.cc index 7c33213610..18f7b7eb2f 100644 --- a/modules/lmdbbackend/lmdbbackend.cc +++ b/modules/lmdbbackend/lmdbbackend.cc @@ -736,6 +736,9 @@ void LMDBBackend::lookup(const QType& type, const DNSName& qdomain, int zoneId, } DNSName relqname = qdomain.makeRelative(hunt); + if (relqname.empty()) { + return; + } // cout<<"get will look for "< nl0 */ - if (t.isRoot()) + if (t.empty()) { + throw std::out_of_range(std::string(__PRETTY_FUNCTION__) + " Attempt to serialize an unset dnsname"); + } + + if (t.isRoot()) { return std::string(1, (char)0); + } + std::string in = t.labelReverse().toDNSStringLC(); // www.ds9a.nl is now 2nl4ds9a3www0 std::string ret; ret.reserve(in.size());