Skip to content

Commit

Permalink
Merge pull request #14847 from omoerbeek/rec-coverity-20241113
Browse files Browse the repository at this point in the history
rec: bunch of coverity reports, all low severity
  • Loading branch information
omoerbeek authored Nov 15, 2024
2 parents 1ea93b3 + 67cee62 commit c8c4fc6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
3 changes: 1 addition & 2 deletions pdns/recursordist/rec-main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down
5 changes: 2 additions & 3 deletions pdns/recursordist/rec-xfr.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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)) {
Expand Down
4 changes: 3 additions & 1 deletion pdns/recursordist/rec-xfr.hh
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public:
{
d_name = name;
}
[[nodiscard]] auto getName() const
[[nodiscard]] const DNSName& getName() const
{
return d_name;
}
Expand Down Expand Up @@ -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))
{}
Expand All @@ -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))
{}
Expand Down

0 comments on commit c8c4fc6

Please sign in to comment.