summaryrefslogtreecommitdiffstats
path: root/crypto/modes
diff options
context:
space:
mode:
authorPauli <ppzgs1@gmail.com>2021-03-17 11:40:13 +1000
committerPauli <ppzgs1@gmail.com>2021-03-18 21:14:56 +1000
commitb875e0e820b07420429ebb90724ed28686a98853 (patch)
treec8a73b6089a010080078203e103b315c4cc33aec /crypto/modes
parentcf3306dc6b37cc24ea50cebc227a9354fefce158 (diff)
modes: fix coverity 1449851: overlapping memory copy
Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14584)
Diffstat (limited to 'crypto/modes')
-rw-r--r--crypto/modes/cbc128.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/crypto/modes/cbc128.c b/crypto/modes/cbc128.c
index df0ab244f8..9ac9299f65 100644
--- a/crypto/modes/cbc128.c
+++ b/crypto/modes/cbc128.c
@@ -114,7 +114,8 @@ void CRYPTO_cbc128_decrypt(const unsigned char *in, unsigned char *out,
out += 16;
}
}
- memcpy(ivec, iv, 16);
+ if (ivec != iv)
+ memcpy(ivec, iv, 16);
} else {
if (STRICT_ALIGNMENT &&
((size_t)in | (size_t)out | (size_t)ivec) % sizeof(size_t) != 0) {