From 77c67dfb2607618f5e7940486daebafd42a502ab Mon Sep 17 00:00:00 2001 From: Brian Wellington Date: Wed, 7 Jun 2000 01:32:47 +0000 Subject: [PATCH] Repeatedly querying for nonexistant data could lead to a crash. --- lib/dns/validator.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/dns/validator.c b/lib/dns/validator.c index 3819b9c29c..97681d751b 100644 --- a/lib/dns/validator.c +++ b/lib/dns/validator.c @@ -683,6 +683,7 @@ get_key(dns_validator_t *val, dns_rdata_sig_t *siginfo) { /* * We have an rrset for the given keyname. */ + val->keyset = &val->frdataset; if (val->frdataset.trust == dns_trust_pending && dns_rdataset_isassociated(&val->fsigrdataset)) { @@ -723,7 +724,7 @@ get_key(dns_validator_t *val, dns_rdata_sig_t *siginfo) { validator_log(val, ISC_LOG_DEBUG(3), "keyset with trust %d", val->frdataset.trust); - result = get_dst_key(val, siginfo, &val->frdataset); + result = get_dst_key(val, siginfo, val->keyset); if (result != ISC_R_SUCCESS) { /* * Either the key we're looking for is not @@ -762,7 +763,8 @@ get_key(dns_validator_t *val, dns_rdata_sig_t *siginfo) { result = DNS_R_CONTINUE; } - if (dns_rdataset_isassociated(&val->frdataset)) + if (dns_rdataset_isassociated(&val->frdataset) && + val->keyset != &val->frdataset) dns_rdataset_disassociate(&val->frdataset); if (dns_rdataset_isassociated(&val->fsigrdataset)) dns_rdataset_disassociate(&val->fsigrdataset);