result could be set incorrectly in validated()

during a recent refactoring of validated(), a line was
removed, causing 'result' to be left unchanged. this
wasted time continuing to try to validate when a
non-recoverable error had occured, and caused the wrong
reason to be logged in add_bad().
This commit is contained in:
Evan Hunt 2025-08-13 23:11:29 -07:00
parent 144d8f4295
commit 70e99bb27a

View file

@ -5435,8 +5435,8 @@ validated(void *arg) {
FCTXTRACE("validation failed");
inc_stats(res, dns_resstatscounter_valfail);
fctx->valfail++;
fctx->vresult = val->result;
if (fctx->vresult != DNS_R_BROKENCHAIN) {
result = fctx->vresult = val->result;
if (result != DNS_R_BROKENCHAIN) {
if (val->rdataset != NULL) {
delete_rrset(fctx, val->name, val->type,
val->sigrdataset != NULL);