]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
rec: bunch of coverity reports, all low severity 14847/head
authorOtto Moerbeek <otto.moerbeek@open-xchange.com>
Wed, 13 Nov 2024 15:37:16 +0000 (16:37 +0100)
committerOtto Moerbeek <otto.moerbeek@open-xchange.com>
Fri, 15 Nov 2024 08:49:25 +0000 (09:49 +0100)
pdns/recursordist/rec-main.cc
pdns/recursordist/rec-xfr.cc
pdns/recursordist/rec-xfr.hh

index a9b0e595cdefef826dc5dc6120c752d102644c88..d3d985b9f493cc778496065a0ea9a9f5693a6b3b 100644 (file)
@@ -3583,8 +3583,7 @@ static void activateForwardingCatalogZones(LuaConfigItems& lci)
     params.zoneIdx = idx++;
     auto zone = std::make_shared<CatalogZone>();
     // zoneSizeHint ignored
-    DNSName domain(params.name);
-    zone->setName(domain);
+    zone->setName(DNSName(params.name));
     fcz.d_catz = zone;
   }
 }
index 6a5ecfbf7b01c0ca3840371f21804d2760434bb7..d50daeacea18d32eae7b9d24ca728b0945df9601 100644 (file)
@@ -139,8 +139,7 @@ bool CatalogZone::versionCheck() const
       invalid = true;
       continue;
     }
-    auto str = txt->d_text;
-    if (str != "\"2\"") {
+    if (txt->d_text != "\"2\"") {
       invalid = true;
       continue;
     }
@@ -485,7 +484,7 @@ void FWCatZoneXFR::zoneXFRTracker(ZoneXFRParams params, uint64_t configGeneratio
 
   insertZoneTracker(zoneName, waiter);
 
-  FWCatZoneXFR xfrObject(params);
+  FWCatZoneXFR xfrObject(std::move(params));
   xfrObject.preloadZoneFile(zoneName, oldZone, refresh, configGeneration, waiter, logger);
   bool skipRefreshDelay = isPreloaded;
   while (xfrObject.zoneTrackerIteration(zoneName, oldZone, refresh, skipRefreshDelay, configGeneration, waiter, logger)) {
index 769053d3a543918d7d48a3c5bf39088480029870..05b80f3a2b862bf52700940eba43319c869a66c5 100644 (file)
@@ -72,7 +72,7 @@ public:
   {
     d_name = name;
   }
-  [[nodiscard]] auto getName() const
+  [[nodiscard]] const DNSName& getName() const
   {
     return d_name;
   }
@@ -119,6 +119,7 @@ public:
   static void insertZoneTracker(const DNSName& zoneName, ZoneWaiter& waiter);
   static void clearZoneTracker(const DNSName& zoneName);
 
+  // coverity[pass_by_value] clang-tidy and coverity do not agree here
   ZoneXFR(ZoneXFRParams params) :
     d_params(std::move(params))
   {}
@@ -133,6 +134,7 @@ public:
 class FWCatZoneXFR : ZoneXFR
 {
 public:
+  // coverity[pass_by_value] clang-tidy and coverity do not agree here
   FWCatZoneXFR(ZoneXFRParams params) :
     ZoneXFR(std::move(params))
   {}