From: Christian Hofstaedtler Date: Sat, 17 Dec 2016 16:43:46 +0000 (+0100) Subject: API: correctly take TTL from first record even if we are at the last comment X-Git-Tag: dnsdist-1.1.0~12^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F4781%2Fhead;p=thirdparty%2Fpdns.git API: correctly take TTL from first record even if we are at the last comment Fixes #4766. --- diff --git a/pdns/ws-auth.cc b/pdns/ws-auth.cc index 52c73d72cb..d18afa94b6 100644 --- a/pdns/ws-auth.cc +++ b/pdns/ws-auth.cc @@ -381,7 +381,7 @@ static void fillZone(const DNSName& zonename, HttpResponse* resp) { auto cit = comments.begin(); while (rit != records.end() || cit != comments.end()) { - if (cit == comments.end() || (rit != records.end() && (cit->qname.toString() < rit->qname.toString() || cit->qtype < rit->qtype))) { + if (cit == comments.end() || (rit != records.end() && (cit->qname.toString() <= rit->qname.toString() || cit->qtype < rit->qtype || cit->qtype == rit->qtype))) { current_qname = rit->qname; current_qtype = rit->qtype; ttl = rit->ttl;