From a509b97d2c4efd96e231913d49544ac7cb36b51b Mon Sep 17 00:00:00 2001 From: Tomas Mraz Date: Tue, 10 Jan 2023 18:00:59 +0100 Subject: [PATCH] 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 Reviewed-by: Paul Dale (Merged from https://github.com/openssl/openssl/pull/20018) --- crypto/mem_sec.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/crypto/mem_sec.c b/crypto/mem_sec.c index 8d2c161c70..d29f261ec4 100644 --- a/crypto/mem_sec.c +++ b/crypto/mem_sec.c @@ -24,8 +24,8 @@ #ifndef OPENSSL_NO_SECURE_MEMORY # if defined(_WIN32) # include -# 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. @@ -37,6 +37,7 @@ VirtualLock( _In_ LPVOID lpAddress, _In_ SIZE_T dwSize ); +# endif # endif # endif # include