From: Christian Hofstaedtler Date: Fri, 7 Oct 2016 00:41:47 +0000 (+0200) Subject: nsecrecords: fix var shadowing X-Git-Tag: dnsdist-1.1.0-beta2~88^2~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=550c1c5bc307fb989a68e570ed78e2c0b3adcc79;p=thirdparty%2Fpdns.git nsecrecords: fix var shadowing --- diff --git a/pdns/nsecrecords.cc b/pdns/nsecrecords.cc index 4796f4d40c..b2dff458c5 100644 --- a/pdns/nsecrecords.cc +++ b/pdns/nsecrecords.cc @@ -214,7 +214,6 @@ NSEC3RecordContent::DNSRecordContent* NSEC3RecordContent::make(const DNSRecord & pr.xfrBlob(ret->d_salt, len); pr.xfr8BitInt(len); - pr.xfrBlob(ret->d_nexthash, len); string bitmap; @@ -230,14 +229,14 @@ NSEC3RecordContent::DNSRecordContent* NSEC3RecordContent::make(const DNSRecord & for(unsigned int n = 0; n+1 < bitmap.size();) { unsigned int window=static_cast(bitmap[n++]); - unsigned int len=static_cast(bitmap[n++]); + unsigned int innerlen=static_cast(bitmap[n++]); // end if zero padding and ensure packet length - if(window == 0&&len == 0) break; - if(n+len>bitmap.size()) + if(window == 0&&innerlen == 0) break; + if(n+innerlen>bitmap.size()) throw MOADNSException("NSEC record with bitmap length > packet length"); - for(unsigned int k=0; k < len; k++) { + for(unsigned int k=0; k < innerlen; k++) { uint8_t val=bitmap[n++]; for(int bit = 0; bit < 8 ; ++bit , val>>=1) if(val & 1) {