]> granicus.if.org Git - pdns/commitdiff
some further empty dnsname checks, although I'm not sure this should be necessary
authorbert hubert <bert.hubert@netherlabs.nl>
Fri, 6 Nov 2015 21:46:54 +0000 (22:46 +0100)
committerbert hubert <bert.hubert@netherlabs.nl>
Fri, 6 Nov 2015 21:46:54 +0000 (22:46 +0100)
modules/bindbackend/bindbackend2.cc

index e35896aed99b282bba6349e9b01cd4b49f52ae3f..a720671477b685e0b0c6fcef192380ee0ac6a2a5 100644 (file)
@@ -889,10 +889,17 @@ bool Bind2Backend::findBeforeAndAfterUnhashed(BB2DomainInfo& bbd, const DNSName&
     while(iter == records->end() || (qname.canonCompare(iter->qname)) || (!(iter->auth) && (!(iter->qtype == QType::NS))) || (!(iter->qtype)))
       iter--;
 
-    before=iter->qname.labelReverse().toString(" ",false);
+    if(iter->qname.empty())
+      before.clear();
+    else {
+      before=iter->qname.labelReverse().toString(" ",false);
+    }
   }
   else {
-    before=qname.labelReverse().toString(" ",false);
+    if(qname.empty())
+      before.clear();
+    else
+      before=qname.labelReverse().toString(" ",false);
   }
 
   //cerr<<"Now after"<<endl;