summaryrefslogtreecommitdiffstats
path: root/crypto
diff options
context:
space:
mode:
authorTomas Mraz <tomas@openssl.org>2023-01-10 18:00:59 +0100
committerTomas Mraz <tomas@openssl.org>2023-01-12 10:47:39 +0100
commite72a0ab363e8e6b175ab02e49d500eea0bf0998a (patch)
treebd11034d58e3d6d5d554005d2e869aa0b08a5036 /crypto
parente33c37aead7e7dd5647d949db7be875c8fa8c137 (diff)
Do not check definition of a macro and use it in a single condition
The condition evaluation in #if conditions does not tolerate this if the macro is not defined. Fixes #19628 Reviewed-by: Hugo Landau <hlandau@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/20018) (cherry picked from commit a509b97d2c4efd96e231913d49544ac7cb36b51b)
Diffstat (limited to 'crypto')
-rw-r--r--crypto/mem_sec.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/crypto/mem_sec.c b/crypto/mem_sec.c
index 60559a930e..9da4b9bb49 100644
--- a/crypto/mem_sec.c
+++ b/crypto/mem_sec.c
@@ -23,8 +23,8 @@
#ifndef OPENSSL_NO_SECURE_MEMORY
# if defined(_WIN32)
# include <windows.h>
-# if defined(WINAPI_FAMILY_PARTITION) \
- && !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM)
+# if defined(WINAPI_FAMILY_PARTITION)
+# if !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM)
/*
* While VirtualLock is available under the app partition (e.g. UWP),
* the headers do not define the API. Define it ourselves instead.
@@ -36,6 +36,7 @@ VirtualLock(
_In_ LPVOID lpAddress,
_In_ SIZE_T dwSize
);
+# endif
# endif
# endif
# include <stdlib.h>