From: Otto Moerbeek Date: Wed, 13 Nov 2024 15:37:16 +0000 (+0100) Subject: rec: bunch of coverity reports, all low severity X-Git-Tag: rec-5.2.0-beta1~18^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F14847%2Fhead;p=thirdparty%2Fpdns.git rec: bunch of coverity reports, all low severity --- diff --git a/pdns/recursordist/rec-main.cc b/pdns/recursordist/rec-main.cc index a9b0e595cd..d3d985b9f4 100644 --- a/pdns/recursordist/rec-main.cc +++ b/pdns/recursordist/rec-main.cc @@ -3583,8 +3583,7 @@ static void activateForwardingCatalogZones(LuaConfigItems& lci) params.zoneIdx = idx++; auto zone = std::make_shared(); // zoneSizeHint ignored - DNSName domain(params.name); - zone->setName(domain); + zone->setName(DNSName(params.name)); fcz.d_catz = zone; } } diff --git a/pdns/recursordist/rec-xfr.cc b/pdns/recursordist/rec-xfr.cc index 6a5ecfbf7b..d50daeacea 100644 --- a/pdns/recursordist/rec-xfr.cc +++ b/pdns/recursordist/rec-xfr.cc @@ -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)) { diff --git a/pdns/recursordist/rec-xfr.hh b/pdns/recursordist/rec-xfr.hh index 769053d3a5..05b80f3a2b 100644 --- a/pdns/recursordist/rec-xfr.hh +++ b/pdns/recursordist/rec-xfr.hh @@ -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)) {}