Skip to content

Commit 4cf7fae

Browse files
committed
- Fix for #1183: release nsec3 hashes per test file.
1 parent a2ac980 commit 4cf7fae

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

doc/Changelog

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
15 November 2024: Wouter
22
- Fix #1183: the data being used is released in method
33
nsec3_hash_test_entry.
4+
- Fix for #1183: release nsec3 hashes per test file.
45

56
8 November 2024: Yorgos
67
- More descriptive text for 'harden-algo-downgrade'.

testcode/unitverify.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@ nsec3_hash_test_entry(struct entry* e, rbtree_type* ct,
425425
{
426426
struct query_info qinfo;
427427
struct reply_info* rep = NULL;
428-
struct ub_packed_rrset_key* answer, *nsec3;
428+
struct ub_packed_rrset_key* answer, *nsec3, *nsec3_region;
429429
struct nsec3_cached_hash* hash = NULL;
430430
int ret;
431431
uint8_t* qname;
@@ -443,7 +443,11 @@ nsec3_hash_test_entry(struct entry* e, rbtree_type* ct,
443443
/* check test is OK */
444444
unit_assert(nsec3 && answer && qname);
445445

446-
ret = nsec3_hash_name(ct, region, buf, nsec3, 0, qname,
446+
/* Copy the nsec3 to the region, so it can stay referenced by the
447+
* ct tree entry. The region is freed when the file is done. */
448+
nsec3_region = packed_rrset_copy_region(nsec3, region, 0);
449+
450+
ret = nsec3_hash_name(ct, region, buf, nsec3_region, 0, qname,
447451
qinfo.qname_len, &hash);
448452
if(ret < 1) {
449453
printf("Bad nsec3_hash_name retcode %d\n", ret);
@@ -458,7 +462,6 @@ nsec3_hash_test_entry(struct entry* e, rbtree_type* ct,
458462

459463
reply_info_parsedelete(rep, alloc);
460464
query_info_clear(&qinfo);
461-
rbtree_init(ct, &nsec3_hash_cmp); /* remove refs freed by parsedelete */
462465
}
463466

464467

0 commit comments

Comments
 (0)