]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
auth: Apply Coverity's suggestions to initialize field members
authorRemi Gacogne <remi.gacogne@powerdns.com>
Mon, 17 Jul 2023 10:17:38 +0000 (12:17 +0200)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Mon, 17 Jul 2023 10:17:38 +0000 (12:17 +0200)
modules/bindbackend/bindbackend2.hh
modules/lua2backend/lua2api2.hh
modules/remotebackend/remotebackend.hh
pdns/dnsbackend.hh
pdns/dnsreplay.cc
pdns/dnssecinfra.hh
pdns/pkcs11signers.cc

index 5d35544fcde05cbe386507d9c33ec5ba4b765eed..7bd14f7d0bf6a34b8381f5b3629037407e84b34a 100644 (file)
@@ -150,7 +150,7 @@ public:
   }
 
   DNSName d_name; //!< actual name of the domain
-  DomainInfo::DomainKind d_kind; //!< the kind of domain
+  DomainInfo::DomainKind d_kind{DomainInfo::Native}; //!< the kind of domain
   string d_filename; //!< full absolute filename of the zone on disk
   string d_status; //!< message describing status of a domain, for human consumption
   vector<ComboAddress> d_masters; //!< IP address of the master of this domain
@@ -159,16 +159,16 @@ public:
   time_t d_ctime{0}; //!< last known ctime of the file on disk
   time_t d_lastcheck{0}; //!< last time domain was checked for freshness
   uint32_t d_lastnotified{0}; //!< Last serial number we notified our slaves of
-  unsigned int d_id; //!< internal id of the domain
+  unsigned int d_id{0}; //!< internal id of the domain
   mutable bool d_checknow; //!< if this domain has been flagged for a check
-  bool d_loaded; //!< if a domain is loaded
+  bool d_loaded{false}; //!< if a domain is loaded
   bool d_wasRejectedLastReload{false}; //!< if the domain was rejected during Bind2Backend::queueReloadAndStore
   bool d_nsec3zone{false};
   NSEC3PARAMRecordContent d_nsec3param;
 
 private:
   time_t getCtime();
-  time_t d_checkinterval;
+  time_t d_checkinterval{0};
 };
 
 class SSQLite3;
@@ -268,10 +268,10 @@ private:
     DNSName qname;
     DNSName domain;
 
-    int id;
+    int id{-1};
     QType qtype;
-    bool d_list;
-    bool mustlog;
+    bool d_list{false};
+    bool mustlog{false};
 
   private:
     bool get_normal(DNSResourceRecord&);
index 1f11a9afd52dac9557d9015d56c6b769fa118f8d..649a808f1149c27d8c9b41eee34d3819b90e66cc 100644 (file)
@@ -426,8 +426,8 @@ public:
 
 private:
   std::list<DNSResourceRecord> d_result;
-  bool d_debug_log;
-  bool d_dnssec;
+  bool d_debug_log{false};
+  bool d_dnssec{false};
 
   lookup_call_t f_lookup;
   list_call_t f_list;
index 97c683895321aa55eb9de922a5ba6082d7232ff2..078594e7f32984078eebdbc829ccd805535af759 100644 (file)
@@ -129,7 +129,7 @@ private:
   void connect();
   std::string d_endpoint;
   int d_timeout;
-  int d_timespent;
+  int d_timespent{0};
   std::map<std::string, std::string> d_options;
   std::unique_ptr<void, int (*)(void*)> d_ctx;
   std::unique_ptr<void, int (*)(void*)> d_sock;
index 5859c77dceb1081e157c4f6cf77f7873247d106c..12e989ad99c08f9487e0cdb79b23b7bf4d0f858b 100644 (file)
@@ -212,10 +212,10 @@ public:
 
   struct KeyData {
     std::string content;
-    unsigned int id;
-    unsigned int flags;
-    bool active;
-    bool published;
+    unsigned int id{0};
+    unsigned int flags{0};
+    bool active{false};
+    bool published{false};
   };
 
   virtual bool getDomainKeys(const DNSName& /* name */, std::vector<KeyData>& /* keys */) { return false; }
index b270f45a43a8ab5f94f3f23afa582c62a1832ffc..1ba97da20440d825a4ff23cf45f2b4b2b04d47c9 100644 (file)
@@ -175,7 +175,7 @@ struct QuestionData
   int d_assignedID;
   MOADNSParser::answers_t d_origAnswers, d_newAnswers;
   int d_origRcode, d_newRcode;
-  struct timeval d_resentTime;
+  struct timeval d_resentTime{};
   bool d_norecursionavailable;
   bool d_origlate, d_newlate;
 };
index 2ba501764050fd568999d8ee9fa4233714f5c9d6..0ddb54eae6dc9a1e2f6f82dffab88ba7bc0aaa4f 100644 (file)
@@ -248,8 +248,8 @@ private:
 
   DNSKEYRecordContent d_dnskey;
   std::shared_ptr<DNSCryptoKeyEngine> d_key;
-  uint16_t d_flags;
-  uint8_t d_algorithm;
+  uint16_t d_flags{0};
+  uint8_t d_algorithm{0};
 };
 
 
index 9269c9e5f8af125075595c5c7157c62d3a8ad1b9..5b944f2a1dff5e9bed3257fc5857669acc3bd8aa 100644 (file)
@@ -79,8 +79,8 @@ using CkaValueType = enum { Attribute_Byte, Attribute_Long, Attribute_String };
 class P11KitAttribute {
 private:
   CK_ATTRIBUTE_TYPE type;
-  CK_BYTE ckByte;
-  CK_ULONG ckLong;
+  CK_BYTE ckByte{0};
+  CK_ULONG ckLong{0};
   std::string ckString;
   CkaValueType ckType;
   std::unique_ptr<unsigned char[]> buffer;