From df3c2392caa5735657ff6bcddd43e252f672ac33 Mon Sep 17 00:00:00 2001 From: merge-script Date: Fri, 26 Jul 2024 07:08:49 +0100 Subject: [PATCH] Merge bitcoin/bitcoin#26950: cleanse: switch to SecureZeroMemory for Windows cross-compile c399c80a09a393d38368a44ef04753e9f62350f0 cleanse: Use SecureZeroMemory for mingw-w64 (release) builds (fanquake) Pull request description: This PR switches our Windows release builds to use the [`SecureZeroMemory()`](https://learn.microsoft.com/en-us/previous-versions/windows/desktop/legacy/aa366877(v=vs.85)) provided by mingw-w64. ACKs for top commit: sipa: utACK c399c80a09a393d38368a44ef04753e9f62350f0 TheCharlatan: ACK c399c80a09a393d38368a44ef04753e9f62350f0 Tree-SHA512: dbb20b16c85061d2f9408a3cf69cecc16765f8f61b25a1707146767b664c7ad0caf36975380814ef8e7c49a30199daebac6d5d7a3585354d1adac8e9770199c6 --- src/support/cleanse.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/support/cleanse.cpp b/src/support/cleanse.cpp index a8ddcd793f..4e370f1516 100644 --- a/src/support/cleanse.cpp +++ b/src/support/cleanse.cpp @@ -7,14 +7,14 @@ #include -#if defined(_MSC_VER) -#include // For SecureZeroMemory. +#if defined(WIN32) +#include #endif void memory_cleanse(void *ptr, size_t len) { -#if defined(_MSC_VER) - /* SecureZeroMemory is guaranteed not to be optimized out by MSVC. */ +#if defined(WIN32) + /* SecureZeroMemory is guaranteed not to be optimized out. */ SecureZeroMemory(ptr, len); #else std::memset(ptr, 0, len);