mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-09-01 15:05:23 +00:00
2004. [bug] dns_tsig_sign() could pass a NULL pointer to
dst_context_destroy() when cleaning up after a error. [RT #15835]
This commit is contained in:
4
CHANGES
4
CHANGES
@@ -1,3 +1,7 @@
|
|||||||
|
2004. [bug] dns_tsig_sign() could pass a NULL pointer to
|
||||||
|
dst_context_destroy() when cleaning up after a
|
||||||
|
error. [RT #15835]
|
||||||
|
|
||||||
2003. [bug] libbind: The DNS name/address lookup functions could
|
2003. [bug] libbind: The DNS name/address lookup functions could
|
||||||
occasionally follow a random pointer due to
|
occasionally follow a random pointer due to
|
||||||
structures not being completely zeroed. [RT #15806]
|
structures not being completely zeroed. [RT #15806]
|
||||||
|
@@ -16,7 +16,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* $Id: tsig.c,v 1.124 2006/01/27 23:57:46 marka Exp $
|
* $Id: tsig.c,v 1.125 2006/03/08 03:51:01 marka Exp $
|
||||||
*/
|
*/
|
||||||
/*! \file */
|
/*! \file */
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
@@ -765,7 +765,7 @@ dns_tsig_sign(dns_message_t *msg) {
|
|||||||
goto cleanup_signature;
|
goto cleanup_signature;
|
||||||
ret = isc_buffer_allocate(msg->mctx, &dynbuf, 512);
|
ret = isc_buffer_allocate(msg->mctx, &dynbuf, 512);
|
||||||
if (ret != ISC_R_SUCCESS)
|
if (ret != ISC_R_SUCCESS)
|
||||||
goto cleanup_signature;
|
goto cleanup_rdata;
|
||||||
ret = dns_rdata_fromstruct(rdata, dns_rdataclass_any,
|
ret = dns_rdata_fromstruct(rdata, dns_rdataclass_any,
|
||||||
dns_rdatatype_tsig, &tsig, dynbuf);
|
dns_rdatatype_tsig, &tsig, dynbuf);
|
||||||
if (ret != ISC_R_SUCCESS)
|
if (ret != ISC_R_SUCCESS)
|
||||||
@@ -781,7 +781,7 @@ dns_tsig_sign(dns_message_t *msg) {
|
|||||||
owner = NULL;
|
owner = NULL;
|
||||||
ret = dns_message_gettempname(msg, &owner);
|
ret = dns_message_gettempname(msg, &owner);
|
||||||
if (ret != ISC_R_SUCCESS)
|
if (ret != ISC_R_SUCCESS)
|
||||||
goto cleanup_context;
|
goto cleanup_rdata;
|
||||||
dns_name_init(owner, NULL);
|
dns_name_init(owner, NULL);
|
||||||
ret = dns_name_dup(&key->name, msg->mctx, owner);
|
ret = dns_name_dup(&key->name, msg->mctx, owner);
|
||||||
if (ret != ISC_R_SUCCESS)
|
if (ret != ISC_R_SUCCESS)
|
||||||
@@ -813,18 +813,17 @@ dns_tsig_sign(dns_message_t *msg) {
|
|||||||
dns_message_puttemprdatalist(msg, &datalist);
|
dns_message_puttemprdatalist(msg, &datalist);
|
||||||
cleanup_owner:
|
cleanup_owner:
|
||||||
dns_message_puttempname(msg, &owner);
|
dns_message_puttempname(msg, &owner);
|
||||||
goto cleanup_context;
|
goto cleanup_rdata;
|
||||||
|
|
||||||
cleanup_dynbuf:
|
cleanup_dynbuf:
|
||||||
isc_buffer_free(&dynbuf);
|
isc_buffer_free(&dynbuf);
|
||||||
|
cleanup_rdata:
|
||||||
|
dns_message_puttemprdata(msg, &rdata);
|
||||||
cleanup_signature:
|
cleanup_signature:
|
||||||
if (tsig.signature != NULL)
|
if (tsig.signature != NULL)
|
||||||
isc_mem_put(mctx, tsig.signature, sigsize);
|
isc_mem_put(mctx, tsig.signature, sigsize);
|
||||||
|
|
||||||
cleanup_context:
|
cleanup_context:
|
||||||
if (rdata != NULL)
|
if (ctx != NULL)
|
||||||
dns_message_puttemprdata(msg, &rdata);
|
dst_context_destroy(&ctx);
|
||||||
dst_context_destroy(&ctx);
|
|
||||||
return (ret);
|
return (ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user