From: Remi Gacogne Date: Mon, 16 Jan 2017 16:53:06 +0000 (+0100) Subject: Make sure `labelsToAdd` is not empty in `getZoneCuts()` X-Git-Tag: rec-4.1.0-alpha1~306^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e2f91e7051975a411445ebd54a2a124c78a7d8ff;p=thirdparty%2Fpdns.git Make sure `labelsToAdd` is not empty in `getZoneCuts()` --- diff --git a/pdns/validate.cc b/pdns/validate.cc index ace1c72f56..e6c6dbe2df 100644 --- a/pdns/validate.cc +++ b/pdns/validate.cc @@ -124,9 +124,12 @@ vector 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)