From: Matthijs Mekking Date: Tue, 13 Oct 2009 09:23:48 +0000 (+0000) Subject: and for nsec3 X-Git-Tag: release-1.6.2~53 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5ef45193926c9f97daebe21bd2d79cb196a75df0;p=thirdparty%2Fldns.git and for nsec3 --- diff --git a/dnssec.c b/dnssec.c index 906cec1c..32969ccb 100644 --- a/dnssec.c +++ b/dnssec.c @@ -1148,10 +1148,10 @@ ldns_create_nsec3(ldns_rdf *cur_owner, ldns_rr_owner(i_rr)) == 0) { /* add type to bitmap */ i_type = ldns_rr_get_type(i_rr); - if ((i_type / 8) + 1 > bm_len) { + if (i_type / 8 >= bm_len) { bitmap = LDNS_XREALLOC(bitmap, uint8_t, (i_type / 8) + 1); /* set to 0 */ - for (; bm_len < (i_type / 8) + 2; bm_len++) { + for (; bm_len < (i_type / 8) + 1; bm_len++) { bitmap[bm_len] = 0; } } @@ -1164,10 +1164,10 @@ ldns_create_nsec3(ldns_rdf *cur_owner, * an unsigned delegation */ if (!emptynonterminal && !rr_list_delegation_only(cur_zone, rrs)) { i_type = LDNS_RR_TYPE_RRSIG; - if (i_type / 8 > bm_len) { + if (i_type / 8 >= bm_len) { bitmap = LDNS_XREALLOC(bitmap, uint8_t, (i_type / 8) + 1); /* set to 0 */ - for (; bm_len <= i_type / 8; bm_len++) { + for (; bm_len < (i_type / 8) + 1; bm_len++) { bitmap[bm_len] = 0; } } @@ -1179,10 +1179,10 @@ ldns_create_nsec3(ldns_rdf *cur_owner, /* and SOA if owner == zone */ if (ldns_dname_compare(cur_zone, cur_owner) == 0) { i_type = LDNS_RR_TYPE_SOA; - if (i_type / 8 > bm_len) { + if (i_type / 8 >= bm_len) { bitmap = LDNS_XREALLOC(bitmap, uint8_t, (i_type / 8) + 1); /* set to 0 */ - for (; bm_len <= i_type / 8; bm_len++) { + for (; bm_len < (i_type / 8) + 1; bm_len++) { bitmap[bm_len] = 0; } }