From d712ac42a0b655c36bc3dabd4fa9ad72855a325c Mon Sep 17 00:00:00 2001 From: Philip Homburg Date: Fri, 24 Jan 2025 12:09:13 +0100 Subject: [PATCH] Fixes issue #266. --- rr.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/rr.c b/rr.c index ec191b74..4be63b9e 100644 --- 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; }