]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Sometimes, coverity and clang-tidy do not agree
authorOtto Moerbeek <otto.moerbeek@open-xchange.com>
Fri, 24 Nov 2023 10:20:19 +0000 (11:20 +0100)
committerOtto Moerbeek <otto.moerbeek@open-xchange.com>
Fri, 24 Nov 2023 10:20:19 +0000 (11:20 +0100)
pdns/axfr-retriever.cc
pdns/recursordist/rec-main.cc

index 47a909618b7eca412795b160aa4c6bf0bba00426..f2630c9aebf47139e20e92ef42c533c21c84229b 100644 (file)
@@ -176,7 +176,7 @@ void AXFRRetriever::timeoutReadn(uint16_t bytes, uint16_t timeoutsec)
   int numread;
   while(n<bytes) {
     // coverity[store_truncates_time_t]
-    int res=waitForData(d_sock, timeoutsec - (time(nullptr) - start));
+    int res=waitForData(d_sock, static_cast<int>(timeoutsec - (time(nullptr) - start)));
     if(res<0)
       throw ResolverException("Reading data from remote nameserver over TCP: "+stringerror());
     if(!res)
index 478839ea41d555e2638bd1b4b6d4e72030e1432e..fb88100af22587c34d5a3ee14098a795dcc6e3db 100644 (file)
@@ -1348,12 +1348,14 @@ void parseACLs()
   }
 
   g_initialAllowFrom = allowFrom;
-  broadcastFunction([=] { return pleaseSupplantAllowFrom(std::move(allowFrom)); });
+  // coverity[copy_contructor_call] maybe this can be avoided, but be careful as pointers get passed to other threads
+  broadcastFunction([=] { return pleaseSupplantAllowFrom(allowFrom); });
 
   auto allowNotifyFrom = parseACL("allow-notify-from-file", "allow-notify-from", log);
 
   g_initialAllowNotifyFrom = allowNotifyFrom;
-  broadcastFunction([=] { return pleaseSupplantAllowNotifyFrom(std::move(allowNotifyFrom)); });
+  // coverity[copy_contructor_call] maybe this can be avoided, but be careful as pointers get passed to other threads
+  broadcastFunction([=] { return pleaseSupplantAllowNotifyFrom(allowNotifyFrom); });
 
   l_initialized = true;
 }