Commit 38e1580fa6 for openssl.org
commit 38e1580fa6de89fd4c0a9822e96dca95a531ee6e
Author: Norbert Pocs <norbertp@openssl.org>
Date: Fri Jun 5 12:19:56 2026 +0200
Fix parentheses in bn_cp_64 macro
Signed-off-by: Norbert Pocs <norbertp@openssl.org>
Reviewed-by: Saša NedvÄ›dický <sashan@openssl.org>
Reviewed-by: Milan Broz <mbroz@openssl.org>
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
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 38068aae69..b820ef7486 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