mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-31 06:25:31 +00:00
initialize header in dns_rdataslab_fromrdataset()
when dns_rdataslab_fromrdataset() is run, in addition to allocating space for a slab header, it also partially initializes it, setting the type match rdataset->type and rdataset->covers, the trust to rdataset->trust, and the TTL to rdataset->ttl.
This commit is contained in:
@@ -302,7 +302,22 @@ free_rdatas:
|
||||
isc_result_t
|
||||
dns_rdataslab_fromrdataset(dns_rdataset_t *rdataset, isc_mem_t *mctx,
|
||||
isc_region_t *region, uint32_t maxrrperset) {
|
||||
return makeslab(rdataset, mctx, region, maxrrperset, false);
|
||||
isc_result_t result;
|
||||
|
||||
result = makeslab(rdataset, mctx, region, maxrrperset, false);
|
||||
if (result == ISC_R_SUCCESS) {
|
||||
dns_slabheader_t *new = (dns_slabheader_t *)region->base;
|
||||
|
||||
*new = (dns_slabheader_t){
|
||||
.type = DNS_TYPEPAIR_VALUE(rdataset->type,
|
||||
rdataset->covers),
|
||||
.trust = rdataset->trust,
|
||||
.ttl = rdataset->ttl,
|
||||
.link = ISC_LINK_INITIALIZER,
|
||||
};
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
|
Reference in New Issue
Block a user