Commit cdf26d5f authored by Vladimír Čunát's avatar Vladimír Čunát Committed by Mark Karpilovskij

dnssec_nsec_bitmap_contains(): fixup errors

I just minimally changed the code to be equivalent the to function
from knot-resolver. (identifier renames complicate the comparison)
I didn't try to verify that the result is completely flawless.
parent 4331fb99
......@@ -96,7 +96,7 @@ bool dnssec_nsec_bitmap_contains(const uint8_t *bitmap, uint16_t size, uint16_t
uint8_t block_size = bitmap[bitmap_pos++]; // Skip window block size.
// Size checks.
if (block_size == 0 || bitmap_pos + block_size < size) {
if (block_size == 0 || bitmap_pos + block_size > size) {
return false;
}
......@@ -106,6 +106,7 @@ bool dnssec_nsec_bitmap_contains(const uint8_t *bitmap, uint16_t size, uint16_t
// Check if the bit for type is set.
return bitmap[bitmap_pos + bitmap_idx] & bit_mask;
}
return false;
} else {
bitmap_pos += block_size;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment