From: Tomas Mraz Date: Tue, 10 Jan 2023 17:00:59 +0000 (+0100) Subject: Do not check definition of a macro and use it in a single condition X-Git-Tag: openssl-3.2.0-alpha1~1537 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a509b97d2c4efd96e231913d49544ac7cb36b51b;p=thirdparty%2Fopenssl.git 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) --- diff --git a/crypto/mem_sec.c b/crypto/mem_sec.c index 8d2c161c707..d29f261ec47 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