]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
credentials: Document that we trying to get the linters to shut the hell up 17376/head
authorRemi Gacogne <remi.gacogne@powerdns.com>
Tue, 19 May 2026 08:29:49 +0000 (10:29 +0200)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Tue, 19 May 2026 08:29:49 +0000 (10:29 +0200)
Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
pdns/credentials.cc

index c91873c205c1ac8a2fd196702609fb9e868cffbf..c82056288d4fcd04be9f671e599c14f7c3d7adb3 100644 (file)
@@ -84,9 +84,11 @@ void SensitiveData::reallyClearContent(void* data, size_t size) noexcept
 SensitiveData::SensitiveData(std::string&& data) :
   d_data(std::move(data))
 {
+  // linters are complaining that we are calling data() and capacity() on a moved-from object,
+  // so clear the object first so they shut up
   data.clear();
 #ifdef HAVE_LIBSODIUM
-  // let's be nice and try to zero out the SSO buffer
+  // let's be nice and try to zero out the SSO buffer, that cannot be moved
   reallyClearContent(data.data(), data.capacity());
 #endif
 #ifdef HAVE_LIBSODIUM