From: Remi Gacogne Date: Mon, 17 Jul 2023 10:17:38 +0000 (+0200) Subject: auth: Apply Coverity's suggestions to initialize field members X-Git-Tag: rec-5.0.0-alpha1~98^2~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ed5dfdee0ef7201a789e1f177e9c959d3e5ad7aa;p=thirdparty%2Fpdns.git auth: Apply Coverity's suggestions to initialize field members --- diff --git a/modules/bindbackend/bindbackend2.hh b/modules/bindbackend/bindbackend2.hh index 5d35544fcd..7bd14f7d0b 100644 --- a/modules/bindbackend/bindbackend2.hh +++ b/modules/bindbackend/bindbackend2.hh @@ -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 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&); diff --git a/modules/lua2backend/lua2api2.hh b/modules/lua2backend/lua2api2.hh index 1f11a9afd5..649a808f11 100644 --- a/modules/lua2backend/lua2api2.hh +++ b/modules/lua2backend/lua2api2.hh @@ -426,8 +426,8 @@ public: private: std::list 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; diff --git a/modules/remotebackend/remotebackend.hh b/modules/remotebackend/remotebackend.hh index 97c6838953..078594e7f3 100644 --- a/modules/remotebackend/remotebackend.hh +++ b/modules/remotebackend/remotebackend.hh @@ -129,7 +129,7 @@ private: void connect(); std::string d_endpoint; int d_timeout; - int d_timespent; + int d_timespent{0}; std::map d_options; std::unique_ptr d_ctx; std::unique_ptr d_sock; diff --git a/pdns/dnsbackend.hh b/pdns/dnsbackend.hh index 5859c77dce..12e989ad99 100644 --- a/pdns/dnsbackend.hh +++ b/pdns/dnsbackend.hh @@ -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& /* keys */) { return false; } diff --git a/pdns/dnsreplay.cc b/pdns/dnsreplay.cc index b270f45a43..1ba97da204 100644 --- a/pdns/dnsreplay.cc +++ b/pdns/dnsreplay.cc @@ -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; }; diff --git a/pdns/dnssecinfra.hh b/pdns/dnssecinfra.hh index 2ba5017640..0ddb54eae6 100644 --- a/pdns/dnssecinfra.hh +++ b/pdns/dnssecinfra.hh @@ -248,8 +248,8 @@ private: DNSKEYRecordContent d_dnskey; std::shared_ptr d_key; - uint16_t d_flags; - uint8_t d_algorithm; + uint16_t d_flags{0}; + uint8_t d_algorithm{0}; }; diff --git a/pdns/pkcs11signers.cc b/pdns/pkcs11signers.cc index 9269c9e5f8..5b944f2a1d 100644 --- a/pdns/pkcs11signers.cc +++ b/pdns/pkcs11signers.cc @@ -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 buffer;