From b43f590376732a4351dfe77458470c4b88cb41a9 Mon Sep 17 00:00:00 2001 From: Christian Hofstaedtler Date: Sat, 17 Dec 2016 17:43:46 +0100 Subject: [PATCH] API: correctly take TTL from first record even if we are at the last comment Fixes #4766. --- pdns/ws-auth.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- 2.47.2