mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-25 02:33:24 -03:00
cleanse: Use SecureZeroMemory for mingw-w64 (release) builds
This commit is contained in:
parent
fa0b5d6882
commit
c399c80a09
1 changed files with 4 additions and 4 deletions
|
@ -7,14 +7,14 @@
|
|||
|
||||
#include <cstring>
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
#include <Windows.h> // For SecureZeroMemory.
|
||||
#if defined(WIN32)
|
||||
#include <windows.h>
|
||||
#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);
|
||||
|
|
Loading…
Add table
Reference in a new issue