]> granicus.if.org Git - pdns/commitdiff
API: correctly take TTL from first record even if we are at the last comment
authorChristian Hofstaedtler <christian@hofstaedtler.name>
Sat, 17 Dec 2016 16:43:46 +0000 (17:43 +0100)
committerChristian Hofstaedtler <christian@hofstaedtler.name>
Sat, 17 Dec 2016 16:43:46 +0000 (17:43 +0100)
Fixes #4766.

pdns/ws-auth.cc

index 52c73d72cb5712b8c22ed0284c1cccc54d409390..d18afa94b64324e239fcf78f96a1fcb4748e0d7a 100644 (file)
@@ -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;