818. [bug] Certain pathological responses to ANY queries could

cause an assertion failure. [RT #1218]
This commit is contained in:
Andreas Gustafsson
2001-04-28 00:21:30 +00:00
parent 9762fd29cc
commit 3242899a56
2 changed files with 19 additions and 14 deletions
+4
View File
@@ -1,3 +1,7 @@
818. [bug] Certain pathological responses to ANY queries could
cause an assertion failure. [RT #1218]
817. [func] Adjust timeouts for dialup zone queries.
816. [func] Report potential problems with log file accessibility
+15 -14
View File
@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: query.c,v 1.193 2001/04/09 21:16:47 gson Exp $ */
/* $Id: query.c,v 1.194 2001/04/28 00:21:23 gson Exp $ */
#include <config.h>
@@ -3083,20 +3083,24 @@ query_find(ns_client_t *client, dns_fetchevent_t *event, dns_rdatatype_t qtype)
* cleanup fname even though we're using it!
*/
query_keepname(client, fname, dbuf);
tname = fname;
result = dns_rdatasetiter_first(rdsiter);
while (result == ISC_R_SUCCESS) {
dns_rdatasetiter_current(rdsiter, rdataset);
if ((qtype == dns_rdatatype_any ||
rdataset->type == qtype) && rdataset->type != 0) {
tname = fname;
query_addrrset(client, &tname, &rdataset, NULL,
query_addrrset(client,
fname != NULL ? &fname : &tname,
&rdataset, NULL,
NULL, DNS_SECTION_ANSWER);
n++;
INSIST(tname != NULL);
/*
* We shouldn't ever fail to add 'rdataset'
* because it's already in the answer.
* rdataset is non-NULL only in certain pathological
* cases involving DNAMEs.
*/
INSIST(rdataset == NULL);
if (rdataset != NULL)
query_putrdataset(client, &rdataset);
rdataset = query_newrdataset(client);
if (rdataset == NULL)
break;
@@ -3108,17 +3112,14 @@ query_find(ns_client_t *client, dns_fetchevent_t *event, dns_rdatatype_t qtype)
}
result = dns_rdatasetiter_next(rdsiter);
}
if (n > 0) {
/*
* As mentioned above, we must now clear fname
* since we're using it.
*/
fname = NULL;
} else {
if (fname != NULL)
dns_message_puttempname(client->message, &fname);
if (n == 0) {
/*
* We didn't match any rdatasets.
*/
dns_message_puttempname(client->message, &fname);
if (qtype == dns_rdatatype_sig &&
result == ISC_R_NOMORE) {
/*