diff options
Diffstat (limited to 'sal/rtl/alloc_cache.cxx')
-rw-r--r-- | sal/rtl/alloc_cache.cxx | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/sal/rtl/alloc_cache.cxx b/sal/rtl/alloc_cache.cxx index 5944043eebb3..578ce33f19ac 100644 --- a/sal/rtl/alloc_cache.cxx +++ b/sal/rtl/alloc_cache.cxx @@ -1314,6 +1314,15 @@ rtl_cache_wsupdate_fini(); #if defined(SAL_UNX) +void SAL_CALL +rtl_secureZeroMemory (void *Ptr, sal_Size Bytes) SAL_THROW_EXTERN_C() +{ + //currently glibc doesn't implement memset_s + volatile char *p = reinterpret_cast<volatile char*>(Ptr); + while (Bytes--) + *p++ = 0; +} + #include <sys/time.h> static void * @@ -1369,6 +1378,12 @@ rtl_cache_wsupdate_fini() #elif defined(SAL_W32) +void SAL_CALL +rtl_secureZeroMemory (void *Ptr, sal_Size Bytes) SAL_THROW_EXTERN_C() +{ + RtlSecureZeroMemory(Ptr, Bytes); +} + static DWORD WINAPI rtl_cache_wsupdate_all (void * arg); |