diff --git a/crypto/modes/cbc128.c b/crypto/modes/cbc128.c index 9ac9299f65..86dd781c55 100644 --- a/crypto/modes/cbc128.c +++ b/crypto/modes/cbc128.c @@ -69,7 +69,8 @@ void CRYPTO_cbc128_encrypt(const unsigned char *in, unsigned char *out, in += 16; out += 16; } - memcpy(ivec, iv, 16); + if (ivec != iv) + memcpy(ivec, iv, 16); } void CRYPTO_cbc128_decrypt(const unsigned char *in, unsigned char *out,