Permalink
Browse files

Make sure `labelsToAdd` is not empty in `getZoneCuts()`

(cherry picked from commit e2f91e7)
  • Loading branch information...
rgacogne committed Jan 16, 2017
1 parent 319c62e commit 5bec36e00e1ec564b4fadea76d58ff840e75768d
Showing with 4 additions and 1 deletion.
  1. +4 −1 pdns/validate.cc
View
@@ -124,9 +124,12 @@ vector<DNSName> getZoneCuts(const DNSName& begin, const DNSName& end, DNSRecordO
// The shortest name is assumed to a zone cut
ret.push_back(qname);
while(qname != begin) {
+ bool foundCut = false;
+ if (labelsToAdd.empty())
+ break;
+
qname.prependRawLabel(labelsToAdd.back());
labelsToAdd.pop_back();
- bool foundCut = false;
auto records = dro.get(qname, (uint16_t)QType::NS);
for (const auto record : records) {
if(record.d_name != qname || record.d_type != QType::NS)

0 comments on commit 5bec36e

Please sign in to comment.