From: Remi Gacogne Date: Mon, 20 Sep 2021 08:03:02 +0000 (+0200) Subject: Credentials: Add move assignement operator X-Git-Tag: dnsdist-1.7.0-alpha1~7^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0bc984f9d029bef039a42501cc93e0966d330629;p=thirdparty%2Fpdns.git Credentials: Add move assignement operator --- diff --git a/pdns/credentials.cc b/pdns/credentials.cc index f2f882db2c..460df05edf 100644 --- a/pdns/credentials.cc +++ b/pdns/credentials.cc @@ -66,6 +66,12 @@ SensitiveData::SensitiveData(std::string&& data) : #endif } +SensitiveData& SensitiveData::operator=(SensitiveData&& rhs) +{ + d_data = std::move(rhs.d_data); + return *this; +} + SensitiveData::SensitiveData(size_t bytes) { d_data.resize(bytes); diff --git a/pdns/credentials.hh b/pdns/credentials.hh index 83b55264ca..6e59c6b40e 100644 --- a/pdns/credentials.hh +++ b/pdns/credentials.hh @@ -29,6 +29,8 @@ class SensitiveData public: SensitiveData(size_t bytes); SensitiveData(std::string&& data); + SensitiveData& operator=(SensitiveData&&); + ~SensitiveData(); void clear(); const std::string& getString() const @@ -92,7 +94,7 @@ private: uint64_t d_parallelFactor{0}; uint64_t d_blockSize{0}; /* seed our hash so it's not predictable */ - uint32_t d_fallbackHashPerturb; + uint32_t d_fallbackHashPerturb{0}; uint32_t d_fallbackHash{0}; /* whether it was constructed from a hashed and salted string */ bool d_wasHashed{false};