From: Willem Toorop Date: Wed, 21 Nov 2012 22:12:52 +0000 (+0000) Subject: Fix ldns_dnssec_zone_new_frm_fp_l to allow the last parsed line of a zone to be an... X-Git-Tag: release-1.6.17rc1~161 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0a85d104cc39ccd43a9f5d6bb657de7d0f692f58;p=thirdparty%2Fldns.git Fix ldns_dnssec_zone_new_frm_fp_l to allow the last parsed line of a zone to be an NSEC3 (or its RRSIG) covering an empty non terminal. Thanks Peter van Dijk --- diff --git a/Changelog b/Changelog index b1582497..5b3246e0 100644 --- a/Changelog +++ b/Changelog @@ -1,4 +1,6 @@ 1.6.17 + * Fix ldns_dnssec_zone_new_frm_fp_l to allow NSEC3 (or its RRSIG) + covering an empty non terminal as the last line. 1.6.16 2012-11-13 * Fix Makefile to build pyldns with BSD make diff --git a/dnssec_zone.c b/dnssec_zone.c index df71a23c..ece11e6a 100644 --- a/dnssec_zone.c +++ b/dnssec_zone.c @@ -699,6 +699,8 @@ ldns_dnssec_zone_new_frm_fp_l(ldns_dnssec_zone** z, FILE* fp, ldns_rdf* origin, ldns_rr_list_push_rr(todo_nsec3s, cur_rr); } + status = LDNS_STATUS_OK; + } else if (status != LDNS_STATUS_OK) goto error; @@ -722,18 +724,13 @@ ldns_dnssec_zone_new_frm_fp_l(ldns_dnssec_zone** z, FILE* fp, ldns_rdf* origin, if (ldns_rr_list_rr_count(todo_nsec3s) > 0) { (void) ldns_dnssec_zone_add_empty_nonterminals(newzone); - for (i = 0; status == LDNS_STATUS_OK && + for (i = 0; status == LDNS_STATUS_OK && i < ldns_rr_list_rr_count(todo_nsec3s); i++) { cur_rr = ldns_rr_list_rr(todo_nsec3s, i); status = ldns_dnssec_zone_add_rr(newzone, cur_rr); } - for (i = 0; status == LDNS_STATUS_OK && - i < ldns_rr_list_rr_count(todo_nsec3_rrsigs); - i++){ - cur_rr = ldns_rr_list_rr(todo_nsec3_rrsigs, i); - status = ldns_dnssec_zone_add_rr(newzone, cur_rr); - } - } else if (ldns_rr_list_rr_count(todo_nsec3_rrsigs) > 0) { + } + if (ldns_rr_list_rr_count(todo_nsec3_rrsigs) > 0) { for (i = 0; status == LDNS_STATUS_OK && i < ldns_rr_list_rr_count(todo_nsec3_rrsigs); i++){