Merge branch 'master' of github.com:awakecoding/FreeRDP

This commit is contained in:
Marc-André Moreau 2013-11-01 20:24:14 -04:00
commit 975562487d
2 changed files with 14 additions and 1 deletions

View File

@ -30,9 +30,11 @@
#define CopyMemory(Destination, Source, Length) memcpy((Destination), (Source), (Length)) #define CopyMemory(Destination, Source, Length) memcpy((Destination), (Source), (Length))
#define MoveMemory(Destination, Source, Length) memmove((Destination), (Source), (Length)) #define MoveMemory(Destination, Source, Length) memmove((Destination), (Source), (Length))
#define FillMemory(Destination, Length, Fill) memset((Destination), (Fill), (Length)) #define FillMemory(Destination, Length, Fill) memset((Destination), (Fill), (Length))
#define ZeroMemory(Destination, Length) memset((Destination), 0, (Length)) #define ZeroMemory(Destination, Length) memset((Destination), 0, (Length))
WINPR_API PVOID SecureZeroMemory(PVOID ptr, SIZE_T cnt);
#endif #endif
#include <winpr/heap.h> #include <winpr/heap.h>

View File

@ -28,6 +28,17 @@
#ifndef _WIN32 #ifndef _WIN32
PVOID SecureZeroMemory(PVOID ptr, SIZE_T cnt)
{
volatile BYTE* p = ptr;
while (cnt--)
{
*p = 0;
p++;
}
return ptr;
}
#endif #endif