]> granicus.if.org Git - php/commitdiff
Add RtlSecureZeroMemory to explicit_bzero() compile case
authorAnatol Belski <ab@php.net>
Fri, 26 Jan 2018 20:32:09 +0000 (21:32 +0100)
committerAnatol Belski <ab@php.net>
Fri, 26 Jan 2018 20:34:31 +0000 (21:34 +0100)
just in case one would use the function directly. The use of
ZEND_SECURE_ZERO could be eliminated now, too. Or it can be
kept for BC.

main/explicit_bzero.c

index 22d768d18bcc2061d8e1f4319d686f5203bbbfb4..652c6287965b6a1e67f9940c0a39f9c00cc1814e 100644 (file)
@@ -34,6 +34,8 @@ PHPAPI void php_explicit_bzero(void *dst, size_t siz)
 {
 #if HAVE_EXPLICIT_MEMSET
     explicit_memset(dst, 0, siz);
+#elif defined(PHP_WIN32)
+       RtlSecureZeroMemory(dst, siz);
 #elif defined(__GNUC__)
        memset(dst, 0, siz);
        asm __volatile__("" :: "r"(dst) : "memory");