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:16:55 +1000
commit81198bf323ea9deda907714170d329ca7d2ff01f (patch)
tree0e5c55cf7c50e74ecd9c8206938eef8e7fa1cc8e /crypto/modes
parent8129ac6ac4c0ca3a488c225cde580ede7dabe874 (diff)
modes: fix coverity 1449851: overlapping memory copy
Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14584) (cherry picked from commit b875e0e820b07420429ebb90724ed28686a98853)
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 4595b0f502..78949c1ed7 100644
--- a/crypto/modes/cbc128.c
+++ b/crypto/modes/cbc128.c
@@ -115,7 +115,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) {