+4289. [bug] The server could crash due to memory being used
+ after it was freed if a zone transfer timed out.
+ [RT #41297]
+
4288. [bug] Fixed a regression in resolver.c:possibly_mark()
which caused known-bogus servers to be queried
anyway. [RT #41321]
</section>
<section xml:id="relnotes_bugs"><info><title>Bug Fixes</title></info>
<itemizedlist>
+ <listitem>
+ <para>
+ The server could crash due to a use-after-free if a
+ zone transfer timed out. [RT #41297]
+ </para>
+ </listitem>
<listitem>
<para>
Authoritative servers that were marked as bogus (e.g. blackholed
dctx = isc_mem_get(mctx, sizeof(dst_context_t));
if (dctx == NULL)
return (ISC_R_NOMEMORY);
- dctx->key = key;
- dctx->mctx = mctx;
+ memset(dctx, 0, sizeof(*dctx));
+ dst_key_attach(key, &dctx->key);
+ isc_mem_attach(mctx, &dctx->mctx);
dctx->category = category;
if (useforsigning)
dctx->use = DO_SIGN;
else
result = key->func->createctx(key, dctx);
if (result != ISC_R_SUCCESS) {
- isc_mem_put(mctx, dctx, sizeof(dst_context_t));
+ if (dctx->key != NULL)
+ dst_key_free(&dctx->key);
+ isc_mem_putanddetach(&dctx->mctx, dctx, sizeof(dst_context_t));
return (result);
}
dctx->magic = CTX_MAGIC;
dctx = *dctxp;
INSIST(dctx->key->func->destroyctx != NULL);
dctx->key->func->destroyctx(dctx);
+ if (dctx->key != NULL)
+ dst_key_free(&dctx->key);
dctx->magic = 0;
- isc_mem_put(dctx->mctx, dctx, sizeof(dst_context_t));
+ isc_mem_putanddetach(&dctx->mctx, dctx, sizeof(dst_context_t));
*dctxp = NULL;
}