Commit 450fab92 authored by Mark Andrews's avatar Mark Andrews
Browse files

Always clean sig0name in msgresetsigs() and dns_message_renderreset()

The fuzzing harness operates on dns_message_t in non-standard ways
and if 'sig0name' is non-NULL when msgresetsigs() and
dns_message_renderreset() are called it should be cleaned up.
parent fc5c9e6b
......@@ -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);
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->sig0 = NULL;
msg->sig0name = NULL;
}
}
......@@ -2430,6 +2430,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