]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
dnsdist: Initialize DNSCrypt structures 14235/head
authorRemi Gacogne <remi.gacogne@powerdns.com>
Fri, 24 May 2024 09:04:34 +0000 (11:04 +0200)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Fri, 24 May 2024 09:07:39 +0000 (11:07 +0200)
These are always properly initialized later in the code but Coverity
is not convinced, and it's good practice to initialize them anyway.

pdns/dnsdistdist/dnscrypt.hh

index dfb4c9bf81dc1fe5180f5bc6220208e8f3f8c0cc..ff5e40bbdfba62eae21a89bd8545448c61dfba13 100644 (file)
@@ -115,8 +115,8 @@ struct DNSCryptCertSignedData
   using ResolverPublicKeyType = std::array<unsigned char, DNSCRYPT_PROVIDER_PUBLIC_KEY_SIZE>;
   using ResolverPrivateKeyType = std::array<unsigned char, DNSCRYPT_PROVIDER_PRIVATE_KEY_SIZE>;
   using ClientMagicType = std::array<unsigned char, DNSCRYPT_CLIENT_MAGIC_SIZE>;
-  ResolverPublicKeyType resolverPK;
-  ClientMagicType clientMagic;
+  ResolverPublicKeyType resolverPK{};
+  ClientMagicType clientMagic{};
   uint32_t serial{0};
   uint32_t tsStart{0};
   uint32_t tsEnd{0};
@@ -148,10 +148,10 @@ public:
   using ESVersionType = std::array<unsigned char, 2>;
   using ProtocolMinorVersionType = std::array<unsigned char, 2>;
   using CertMagicType = std::array<unsigned char, DNSCRYPT_CERT_MAGIC_SIZE>;
-  CertMagicType magic;
-  ESVersionType esVersion;
-  ProtocolMinorVersionType protocolMinorVersion;
-  std::array<unsigned char, DNSCRYPT_SIGNATURE_SIZE> signature;
+  CertMagicType magic{};
+  ESVersionType esVersion{};
+  ProtocolMinorVersionType protocolMinorVersion{};
+  std::array<unsigned char, DNSCRYPT_SIGNATURE_SIZE> signature{};
   DNSCryptCertSignedData signedData;
 };