From 5bec36e00e1ec564b4fadea76d58ff840e75768d Mon Sep 17 00:00:00 2001 From: Remi Gacogne Date: Mon, 16 Jan 2017 17:53:06 +0100 Subject: [PATCH] Make sure `labelsToAdd` is not empty in `getZoneCuts()` (cherry picked from commit e2f91e7051975a411445ebd54a2a124c78a7d8ff) --- pdns/validate.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pdns/validate.cc b/pdns/validate.cc index 66d3ac02f..27f7114f8 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) -- 2.40.0