From: Norbert Pocs Date: Fri, 5 Jun 2026 10:19:56 +0000 (+0200) Subject: Fix parentheses in bn_cp_64 macro X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=38e1580fa6de89fd4c0a9822e96dca95a531ee6e;p=thirdparty%2Fopenssl.git Fix parentheses in bn_cp_64 macro Signed-off-by: Norbert Pocs Reviewed-by: Saša Nedvědický Reviewed-by: Milan Broz Reviewed-by: Eugene Syromiatnikov MergeDate: Wed Jun 10 13:24:46 2026 (Merged from https://github.com/openssl/openssl/pull/31386) --- diff --git a/crypto/bn/bn_nist.c b/crypto/bn/bn_nist.c index 38068aae698..b820ef74869 100644 --- a/crypto/bn/bn_nist.c +++ b/crypto/bn/bn_nist.c @@ -281,7 +281,7 @@ static void nist_cp_bn(BN_ULONG *dst, const BN_ULONG *src, int top) } #if BN_BITS2 == 64 -#define bn_cp_64(to, n, from, m) (to)[n] = (m >= 0) ? ((from)[m]) : 0 +#define bn_cp_64(to, n, from, m) ((to)[n] = ((m) >= 0) ? ((from)[m]) : 0) #define bn_64_set_0(to, n) (to)[n] = (BN_ULONG)0 /* * two following macros are implemented under assumption that they @@ -309,7 +309,7 @@ static void nist_cp_bn(BN_ULONG *dst, const BN_ULONG *src, int top) bn_32_set_0(to, (n) * 2); \ bn_32_set_0(to, (n) * 2 + 1); \ } -#define bn_cp_32(to, n, from, m) (to)[n] = (m >= 0) ? ((from)[m]) : 0 +#define bn_cp_32(to, n, from, m) ((to)[n] = ((m) >= 0) ? ((from)[m]) : 0) #define bn_32_set_0(to, n) (to)[n] = (BN_ULONG)0; #if defined(_WIN32) && !defined(__GNUC__) #define NIST_INT64 __int64