Commit f2762acd authored by Mark Andrews's avatar Mark Andrews

Merge branch...

Merge branch '2188-bug-in-message-c-673-ensure-isc_mempool_getallocated-msg-namepool-0-failed' into 'main'

Resolve "Bug in message.c:673: ENSURE(isc_mempool_getallocated(msg->namepool) == 0) failed"

Closes #2188

See merge request isc-projects/bind9!4189
parents 0665f01c 5b5f1ba0
......@@ -80,6 +80,11 @@ print_message(dns_message_t *message) {
}
} while (result == ISC_R_NOSPACE);
if (debug) {
fprintf(stderr, "%.*s\n", (int)isc_buffer_usedlength(&buffer),
output);
}
return (result);
}
......
......@@ -526,13 +526,13 @@ msgresetsigs(dns_message_t *msg, bool replying) {
INSIST(dns_rdataset_isassociated(msg->sig0));
dns_rdataset_disassociate(msg->sig0);
isc_mempool_put(msg->rdspool, msg->sig0);
if (msg->sig0name != NULL) {
if (dns_name_dynamic(msg->sig0name)) {
dns_name_free(msg->sig0name, msg->mctx);
}
isc_mempool_put(msg->namepool, msg->sig0name);
}
msg->sig0 = NULL;
}
if (msg->sig0name != NULL) {
if (dns_name_dynamic(msg->sig0name)) {
dns_name_free(msg->sig0name, msg->mctx);
}
isc_mempool_put(msg->namepool, msg->sig0name);
msg->sig0name = NULL;
}
}
......@@ -1456,7 +1456,9 @@ getsection(isc_buffer_t *source, dns_message_t *msg, dns_decompress_t *dctx,
covers = dns_rdata_covers(rdata);
if (covers == 0) {
if (sectionid != DNS_SECTION_ADDITIONAL ||
count != msg->counts[sectionid] - 1) {
count != msg->counts[sectionid] - 1 ||
!dns_name_equal(name, dns_rootname))
{
DO_ERROR(DNS_R_BADSIG0);
} else {
skip_name_search = true;
......@@ -2430,6 +2432,9 @@ dns_message_renderreset(dns_message_t *msg) {
dns_rdataset_disassociate(msg->tsig);
dns_message_puttemprdataset(msg, &msg->tsig);
}
if (msg->sig0name != NULL) {
dns_message_puttempname(msg, &msg->sig0name);
}
if (msg->sig0 != NULL) {
dns_rdataset_disassociate(msg->sig0);
dns_message_puttemprdataset(msg, &msg->sig0);
......
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