From: Bert Hubert Date: Tue, 11 Jan 2011 22:50:46 +0000 (+0000) Subject: add some logic to prevent us crashing on an nsec3 non-narrow zone with only 1 name... X-Git-Tag: auth-3.0~371 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=731c3ea2c843b71b768de2ecb03f3850a41b9ff4;p=pdns add some logic to prevent us crashing on an nsec3 non-narrow zone with only 1 name in it. fix is probably wrong. git-svn-id: svn://svn.powerdns.com/pdns/trunk/pdns@1876 d19b8d6e-7fed-0310-83ef-9ca221ded41b --- diff --git a/pdns/backends/bind/bindbackend2.cc b/pdns/backends/bind/bindbackend2.cc index 4bd0f4d59..f673586d6 100644 --- a/pdns/backends/bind/bindbackend2.cc +++ b/pdns/backends/bind/bindbackend2.cc @@ -861,7 +861,12 @@ bool Bind2Backend::getBeforeAndAfterNamesAbsolute(uint32_t id, const std::string records_by_hashindex_t::const_iterator iter = ttdindex.lower_bound(lqname); // lower_bound(ttdindex.begin(), ttdindex.end(), lqname); // cerr<<"iter == ttdindex.begin(): "<< (iter == ttdindex.begin()) << ", "; // cerr<<"iter == ttdindex.end(): "<< (iter == ttdindex.end()) << endl; - if(iter->nsec3hash == lqname) { + if(iter == ttdindex.end()) { // zone with 1 name? + cerr<<"harrumf - zone with only 1 part probably"<nsec3hash; + unhashed = auth; + } + else if(iter != ttdindex.end() && iter->nsec3hash == lqname) { before = iter->nsec3hash; unhashed = dotConcat(labelReverse(iter->qname), auth); cerr<<"Had direct hit, setting unhashed: "<