Skip to content

Commit 46c3b11

Browse files
committed
Fix size of NSEC window
1 parent 7db4a1c commit 46c3b11

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/generic/nsec.h

+3-4
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ nonnull_all
1313
static really_inline int32_t scan_type(
1414
const char *, size_t, uint16_t *, const mnemonic_t **);
1515

16-
typedef uint8_t nsec_t[256 + 2];
16+
typedef uint8_t nsec_t[32 /* 256 / 8 */ + 2];
1717

1818
nonnull_all
1919
static really_inline int32_t parse_nsec(
@@ -25,9 +25,8 @@ static really_inline int32_t parse_nsec(
2525
{
2626
if (likely(is_contiguous(token))) {
2727
nsec_t *bitmap = (void *)rdata->octets;
28-
//assert(parser->rdata->octets
29-
// FIXME: convert to static assert
30-
//assert(parser->rdata->length < sizeof(parser->rdata) - (256 * (256 + 2)));
28+
assert(rdata->octets <= rdata->limit);
29+
assert((size_t)(rdata->limit - rdata->octets) >= 256 * sizeof(nsec_t));
3130

3231
uint32_t highest_window = 0;
3332
uint32_t windows[256] = { 0 };

0 commit comments

Comments
 (0)