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

1941. [bug] ncache_adderesult() should set eresult even if no

rdataset is passed to it. [RT #15642]
This commit is contained in:
Mark Andrews
2005-11-30 22:51:58 +00:00
parent 470c726bc8
commit 00afe78ab2
2 changed files with 13 additions and 2 deletions

View File

@@ -1,3 +1,6 @@
1941. [bug] ncache_adderesult() should set eresult even if no
rdataset is passed to it. [RT #15642]
1940. [bug] Fixed a number of error conditions reported by
Coverity.

View File

@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: resolver.c,v 1.320 2005/11/30 03:33:49 marka Exp $ */
/* $Id: resolver.c,v 1.321 2005/11/30 22:51:58 marka Exp $ */
/*! \file */
@@ -3808,6 +3808,12 @@ ncache_adderesult(dns_message_t *message, dns_db_t *cache, dns_dbnode_t *node,
isc_result_t *eresultp)
{
isc_result_t result;
dns_rdataset_t rdataset;
if (ardataset == NULL) {
dns_rdataset_init(&rdataset);
ardataset = &rdataset;
}
result = dns_ncache_add(message, cache, node, covers, now,
maxttl, ardataset);
if (result == DNS_R_UNCHANGED || result == ISC_R_SUCCESS) {
@@ -3816,7 +3822,7 @@ ncache_adderesult(dns_message_t *message, dns_db_t *cache, dns_dbnode_t *node,
* care about whether it is DNS_R_NCACHENXDOMAIN or
* DNS_R_NCACHENXRRSET then extract it.
*/
if (ardataset != NULL && ardataset->type == 0) {
if (ardataset->type == 0) {
/*
* The cache data is a negative cache entry.
*/
@@ -3838,6 +3844,8 @@ ncache_adderesult(dns_message_t *message, dns_db_t *cache, dns_dbnode_t *node,
}
result = ISC_R_SUCCESS;
}
if (ardataset == &rdataset && dns_rdataset_isassociated(ardataset))
dns_rdataset_disassociate(ardataset);
return (result);
}