]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
rec: Apply Otto's suggestions 13852/head
authorRemi Gacogne <remi.gacogne@powerdns.com>
Mon, 4 Mar 2024 08:14:58 +0000 (09:14 +0100)
committerOtto Moerbeek <otto.moerbeek@open-xchange.com>
Mon, 4 Mar 2024 09:27:51 +0000 (10:27 +0100)
(cherry picked from commit f8a286bb2a45fb51ea90399b793ec40665824430)

pdns/recursordist/syncres.cc

index 2ee8ee5706203e687136f6aa706c2e23e9dd5353..e442842a4a5333d10a121501c6e75bd5135cd506 100644 (file)
@@ -4421,8 +4421,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
@@ -4752,7 +4752,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;
     }
   }