mirror of
https://github.com/libssh2/libssh2.git
synced 2025-11-21 14:00:51 +03:00
Fix conditional check for HAVE_DECL_SECUREZEROMEMORY
"Unlike the other `AC_CHECK_*S' macros, when a symbol is not declared, HAVE_DECL_symbol is defined to `0' instead of leaving HAVE_DECL_symbol undeclared. When you are sure that the check was performed, use HAVE_DECL_symbol in #if." Source: autoconf documentation for AC_CHECK_DECLS.
This commit is contained in:
@@ -53,9 +53,11 @@
|
|||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_DECL_SECUREZEROMEMORY
|
#if defined(HAVE_DECL_SECUREZEROMEMORY) && HAVE_DECL_SECUREZEROMEMORY
|
||||||
|
#ifdef HAVE_WINDOWS_H
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
@@ -689,7 +691,7 @@ static void * (* const volatile memset_libssh)(void *, int, size_t) = memset;
|
|||||||
|
|
||||||
void _libssh2_explicit_zero(void *buf, size_t size)
|
void _libssh2_explicit_zero(void *buf, size_t size)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_DECL_SECUREZEROMEMORY
|
#if defined(HAVE_DECL_SECUREZEROMEMORY) && HAVE_DECL_SECUREZEROMEMORY
|
||||||
SecureZeroMemory(buf, size);
|
SecureZeroMemory(buf, size);
|
||||||
#elif defined(HAVE_MEMSET_S)
|
#elif defined(HAVE_MEMSET_S)
|
||||||
(void)memset_s(buf, size, 0, size);
|
(void)memset_s(buf, size, 0, size);
|
||||||
|
|||||||
Reference in New Issue
Block a user