]> git.ipfire.org Git - thirdparty/ldns.git/commitdiff
Fixes issue #266. bugfix/266 267/head
authorPhilip Homburg <philip@nlnetlabs.nl>
Fri, 24 Jan 2025 11:09:13 +0000 (12:09 +0100)
committerPhilip Homburg <philip@nlnetlabs.nl>
Fri, 24 Jan 2025 11:09:13 +0000 (12:09 +0100)
rr.c

diff --git a/rr.c b/rr.c
index ec191b74bc4ed7320a9fcf4992af7f909507afef..4be63b9e273eb4e3bee889ffe9d7dadc75e6de5b 100644 (file)
--- a/rr.c
+++ b/rr.c
@@ -2588,6 +2588,14 @@ ldns_rdf_bitmap_known_rr_types_set(ldns_rdf** rdf, int value)
        for (d=rdata_field_descriptors; d < rdata_field_descriptors_end; d++) {
                window  = d->_type >> 8;
                subtype = d->_type & 0xff;
+
+               /* In the code below, windows[window] == 0 means that the
+                * window is not in use. So subtype == 0 is a problem. The
+                * easiest solution is to set subtype to 1, that marks the
+                * window as in use and doesn't have negative effects.
+                */
+               if (subtype == 0)
+                       subtype = 1;
                if (windows[window] < subtype) {
                        windows[window] = subtype;
                }