From e0fde613acb2dcd5be0750f002e80bf345401a2e Mon Sep 17 00:00:00 2001 From: Rich Salz Date: Fri, 29 Jan 2016 12:09:05 -0500 Subject: GH102: Add volatile to CRYPTO_memcmp Can't hurt and seems to prevent problems from some over-aggressive (LTO?) compilers. Reviewed-by: Richard Levitte (cherry picked from commit 98ab57644f44d2d83595c2d0f69138a284d6096b) --- crypto/cryptlib.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'crypto/cryptlib.c') diff --git a/crypto/cryptlib.c b/crypto/cryptlib.c index c9f674ba8e..1925428f5e 100644 --- a/crypto/cryptlib.c +++ b/crypto/cryptlib.c @@ -1016,11 +1016,11 @@ void *OPENSSL_stderr(void) return stderr; } -int CRYPTO_memcmp(const void *in_a, const void *in_b, size_t len) +int CRYPTO_memcmp(const volatile void *in_a, const volatile void *in_b, size_t len) { size_t i; - const unsigned char *a = in_a; - const unsigned char *b = in_b; + const volatile unsigned char *a = in_a; + const volatile unsigned char *b = in_b; unsigned char x = 0; for (i = 0; i < len; i++) -- cgit v1.2.3