]> git.ipfire.org Git - thirdparty/ldns.git/commitdiff
bugfix #725: RR types on the bitmap window border
authorWillem Toorop <willem@nlnetlabs.nl>
Fri, 4 Dec 2015 14:48:19 +0000 (15:48 +0100)
committerWillem Toorop <willem@nlnetlabs.nl>
Fri, 4 Dec 2015 14:48:19 +0000 (15:48 +0100)
Thanks Pieter Lexis

Changelog
dnssec.c

index 99898e71d0f46f3ad486f4d4623a2f32d8f21b79..d21dce0a931b5838f29761f961467fc28af76815 100644 (file)
--- 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
index c9fd74f3fbdaa2582978c1c2d12271d107c29cbb..49cce3203df793a366561a63bf73c53af40604c2 100644 (file)
--- 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];
                        }