]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Folowup to #11986: coverity fixes 12010/head
authorOtto Moerbeek <otto@drijf.net>
Fri, 23 Sep 2022 05:42:17 +0000 (07:42 +0200)
committerOtto Moerbeek <otto@drijf.net>
Fri, 23 Sep 2022 05:42:17 +0000 (07:42 +0200)
Typo in annotations and one missed

pdns/dnssecinfra.cc
pdns/dnswriter.cc
pdns/protozero.hh
pdns/rcpgenerator.cc
pdns/recursor_cache.cc

index ef12e9826cbcbd12286ff6b77dee09dc8e4cbeda..22647234b0b3eb76be7d0b82d85d65698c20c977 100644 (file)
@@ -519,7 +519,7 @@ static DNSKEYRecordContent makeDNSKEYFromDNSCryptoKeyEngine(const std::shared_pt
 
 uint32_t getStartOfWeek()
 {
-  // coverity[store_truncated_time_t]
+  // coverity[store_truncates_time_t]
   uint32_t now = time(nullptr);
   now -= (now % (7*86400));
   return now;
index ed239c80b162770876d957b4acaa1acf33110f70..d4ec06f561daa0a42fe8d3afa5d9eae1c9929ef4 100644 (file)
@@ -438,7 +438,7 @@ template <typename Container> void GenericDNSPacketWriter<Container>::xfrSvcPara
       break;
     case SvcParam::ipv6hint:
       xfr16BitInt(param.getIPHints().size() * 16); // size
-      for (auto a: param.getIPHints()) {
+      for (const auto& a: param.getIPHints()) {
         xfrCAWithoutPort(param.getKey(), a);
       }
       break;
index ecdec1d55ad31e62ee274498ef4fcb9ca23cf628..439d862f4b79eef91855c547de1b9884c8f2d77f 100644 (file)
@@ -108,7 +108,7 @@ namespace pdns {
 
       void setTime(time_t sec, uint32_t usec)
       {
-        // coverity[store_truncated_time_t]
+        // coverity[store_truncates_time_t]
         add_uint32(d_message, Field::timeSec, sec);
         add_uint32(d_message, Field::timeUsec, usec);
       }
index 4d54f23f6b4d8a67ce776ae98f11085e4dc4064b..4e305849c28484a655c6617a2b21eb2b5009239f 100644 (file)
@@ -123,7 +123,7 @@ void RecordTextReader::xfrTime(uint32_t &val)
 
   tm.tm_year-=1900;
   tm.tm_mon-=1;
-  // coverity[store_truncated_time_t]
+  // coverity[store_truncates_time_t]
   val=(uint32_t)Utility::timegm(&tm);
 }
 
index 22e7bff2b270d7f0685e023774bffc2326612722..8244976f9c1d9e0cf4f623a27982342d17272140 100644 (file)
@@ -158,7 +158,7 @@ time_t MemRecursorCache::handleHit(MapCombo::LockedContent& content, MemRecursor
       dr.d_type = entry->d_qtype;
       dr.d_class = QClass::IN;
       dr.d_content = k;
-      // coverity[store_truncated_time_t]
+      // coverity[store_truncates_time_t]
       dr.d_ttl = static_cast<uint32_t>(entry->d_ttd);
       dr.d_place = DNSResourceRecord::ANSWER;
       res->push_back(std::move(dr));
@@ -328,7 +328,7 @@ time_t MemRecursorCache::fakeTTD(MemRecursorCache::OrderedTagIterator_t& entry,
   }
   if (ttl > 0 && SyncRes::s_refresh_ttlperc > 0) {
     const uint32_t deadline = origTTL * SyncRes::s_refresh_ttlperc / 100;
-    // coverity[store_truncated_time_t]
+    // coverity[store_truncates_time_t]
     const bool almostExpired = static_cast<uint32_t>(ttl) <= deadline;
     if (almostExpired && qname != g_rootdnsname) {
       if (refresh) {
@@ -513,7 +513,7 @@ bool MemRecursorCache::CacheEntry::shouldReplace(time_t now, bool auth, vState s
     const time_t ttl = d_ttd - now;
     const uint32_t lockline = d_orig_ttl * percentage / 100;
     // We know ttl is > 0 as d_ttd > now
-    // coverity[store_truncated_time_t]
+    // coverity[store_truncates_time_t]
     const bool locked = static_cast<uint32_t>(ttl) > lockline;
     if (locked) {
       return false;