2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-31 14:35:26 +00:00

2403. [bug] TSIG context leak. [RT #18341]

This commit is contained in:
Mark Andrews
2008-07-28 08:39:52 +00:00
parent cbb8a1b7cb
commit 481e9b573b
3 changed files with 18 additions and 3 deletions

View File

@@ -1,3 +1,5 @@
2403. [bug] TSIG context leak. [RT #18341]
2402. [port] Support Solaris 2.11 and over. [RT #18362] 2402. [port] Support Solaris 2.11 and over. [RT #18362]
2401. [bug] Expect to get E[MN]FILE errno internal_accept() 2401. [bug] Expect to get E[MN]FILE errno internal_accept()

View File

@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE. * PERFORMANCE OF THIS SOFTWARE.
*/ */
/* $Id: message.c,v 1.243 2008/04/03 10:45:35 marka Exp $ */ /* $Id: message.c,v 1.244 2008/07/28 08:39:52 marka Exp $ */
/*! \file */ /*! \file */
@@ -622,6 +622,9 @@ msgreset(dns_message_t *msg, isc_boolean_t everything) {
msg->tsigkey = NULL; msg->tsigkey = NULL;
} }
if (msg->tsigctx != NULL)
dst_context_destroy(&msg->tsigctx);
if (msg->query.base != NULL) { if (msg->query.base != NULL) {
if (msg->free_query != 0) if (msg->free_query != 0)
isc_mem_put(msg->mctx, msg->query.base, isc_mem_put(msg->mctx, msg->query.base,

View File

@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE. * PERFORMANCE OF THIS SOFTWARE.
*/ */
/* $Id: xfrin.c,v 1.160 2008/07/23 23:27:54 marka Exp $ */ /* $Id: xfrin.c,v 1.161 2008/07/28 08:39:52 marka Exp $ */
/*! \file */ /*! \file */
@@ -1075,6 +1075,8 @@ xfrin_send_request(dns_xfrin_ctx_t *xfr) {
xfr->nbytes = 0; xfr->nbytes = 0;
isc_time_now(&xfr->start); isc_time_now(&xfr->start);
msg->id = xfr->id; msg->id = xfr->id;
if (xfr->tsigctx != NULL)
dst_context_destroy(&xfr->tsigctx);
CHECK(render(msg, xfr->mctx, &xfr->qbuffer)); CHECK(render(msg, xfr->mctx, &xfr->qbuffer));
@@ -1210,7 +1212,10 @@ xfrin_recv_done(isc_task_t *task, isc_event_t *ev) {
CHECK(dns_message_settsigkey(msg, xfr->tsigkey)); CHECK(dns_message_settsigkey(msg, xfr->tsigkey));
CHECK(dns_message_setquerytsig(msg, xfr->lasttsig)); CHECK(dns_message_setquerytsig(msg, xfr->lasttsig));
msg->tsigctx = xfr->tsigctx; msg->tsigctx = xfr->tsigctx;
xfr->tsigctx = NULL;
if (xfr->nmsg > 0) if (xfr->nmsg > 0)
msg->tcp_continuation = 1; msg->tcp_continuation = 1;
@@ -1328,9 +1333,11 @@ xfrin_recv_done(isc_task_t *task, isc_event_t *ev) {
xfr->nbytes += tcpmsg->buffer.used; xfr->nbytes += tcpmsg->buffer.used;
/* /*
* Copy the context back. * Take the context back.
*/ */
INSIST(xfr->tsigctx == NULL);
xfr->tsigctx = msg->tsigctx; xfr->tsigctx = msg->tsigctx;
msg->tsigctx = NULL;
dns_message_destroy(&msg); dns_message_destroy(&msg);
@@ -1444,6 +1451,9 @@ maybe_free(dns_xfrin_ctx_t *xfr) {
if (xfr->tcpmsg_valid) if (xfr->tcpmsg_valid)
dns_tcpmsg_invalidate(&xfr->tcpmsg); dns_tcpmsg_invalidate(&xfr->tcpmsg);
if (xfr->tsigctx != NULL)
dst_context_destroy(&xfr->tsigctx);
if ((xfr->name.attributes & DNS_NAMEATTR_DYNAMIC) != 0) if ((xfr->name.attributes & DNS_NAMEATTR_DYNAMIC) != 0)
dns_name_free(&xfr->name, xfr->mctx); dns_name_free(&xfr->name, xfr->mctx);