From: Remi Gacogne Date: Mon, 4 Mar 2024 08:14:58 +0000 (+0100) Subject: rec: Apply Otto's suggestions X-Git-Tag: dnsdist-1.10.0-alpha0~20^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F13847%2Fhead;p=thirdparty%2Fpdns.git rec: Apply Otto's suggestions --- diff --git a/pdns/recursordist/syncres.cc b/pdns/recursordist/syncres.cc index 1afbb69543..359d676072 100644 --- a/pdns/recursordist/syncres.cc +++ b/pdns/recursordist/syncres.cc @@ -4411,8 +4411,8 @@ RCode::rcodes_ SyncRes::updateCacheFromRecords(unsigned int depth, const string& count can be lower than the name's label count if it was synthesized from the wildcard. Note that the difference might be > 1. */ - if (wildcardCandidates.count(rec.d_name) > 0 && isWildcardExpanded(labelCount, *rrsig)) { - wildcardCandidates[rec.d_name] = true; + if (auto wcIt = wildcardCandidates.find(rec.d_name); wcIt != wildcardCandidates.end() && isWildcardExpanded(labelCount, *rrsig)) { + wcIt->second = true; gatherWildcardProof = true; if (!isWildcardExpandedOntoItself(rec.d_name, labelCount, *rrsig)) { /* if we have a wildcard expanded onto itself, we don't need to prove @@ -4742,7 +4742,7 @@ RCode::rcodes_ SyncRes::updateCacheFromRecords(unsigned int depth, const string& if (gatherWildcardProof) { if (auto wcIt = wildcardCandidates.find(qname); wcIt != wildcardCandidates.end() && !wcIt->second) { - // the queried name was not expended from a wildcard, a record in the CNAME chain was, so we don't need to gather wildcard proof now: we will do that when looking up the CNAME chain + // the queried name was not expanded from a wildcard, a record in the CNAME chain was, so we don't need to gather wildcard proof now: we will do that when looking up the CNAME chain gatherWildcardProof = false; } }