From 00abd521b9a4b64d4341b80b10c131bc03d708cf Mon Sep 17 00:00:00 2001 From: Willem Toorop Date: Fri, 4 Dec 2015 15:48:19 +0100 Subject: [PATCH] bugfix #725: RR types on the bitmap window border Thanks Pieter Lexis --- Changelog | 2 ++ dnssec.c | 10 +++++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Changelog b/Changelog index 99898e71..d21dce0a 100644 --- a/Changelog +++ b/Changelog @@ -58,6 +58,8 @@ TBD Thanks Jan-Piet Mens * bugfix: -U option to ldns-signzone to sign with every algorithm Thanks Guido Kroon + * bugfix #725: allow RR-types on the type bitmap window border + Thanks Pieter Lexis 1.6.17 2014-01-10 * Fix ldns_dnssec_zone_new_frm_fp_l to allow the last parsed line of a diff --git a/dnssec.c b/dnssec.c index c9fd74f3..49cce320 100644 --- a/dnssec.c +++ b/dnssec.c @@ -688,9 +688,9 @@ ldns_dnssec_create_nsec_bitmap(ldns_rr_type rr_type_list[], { uint8_t window; /* most significant octet of type */ uint8_t subtype; /* least significant octet of type */ - uint16_t windows[256] /* Max subtype per window */ + int windows[256] /* Max subtype per window */ #ifndef S_SPLINT_S - = { 0 } /* Initialize ALL elements with 0 */ + = { -1 } /* Initialize ALL elements with 0 */ #endif ; ldns_rr_type* d; /* used to traverse rr_type_list*/ @@ -720,7 +720,7 @@ ldns_dnssec_create_nsec_bitmap(ldns_rr_type rr_type_list[], */ sz = 0; for (i = 0; i < 256; i++) { - if (windows[i]) { + if (windows[i] >= 0) { sz += windows[i] / 8 + 3; } } @@ -732,14 +732,14 @@ ldns_dnssec_create_nsec_bitmap(ldns_rr_type rr_type_list[], return NULL; } for (i = 0; i < 256; i++) { - if (windows[i]) { + if (windows[i] >= 0) { *dptr++ = (uint8_t)i; *dptr++ = (uint8_t)(windows[i] / 8 + 1); /* Now let windows[i] index the bitmap * within data */ - windows[i] = (uint16_t)(dptr - data); + windows[i] = (int)(dptr - data); dptr += dptr[-1]; } -- 2.47.3