summaryrefslogtreecommitdiffstats
path: root/crypto/modes
diff options
context:
space:
mode:
authorPauli <ppzgs1@gmail.com>2021-03-17 11:41:48 +1000
committerPauli <ppzgs1@gmail.com>2021-03-18 21:16:23 +1000
commit8129ac6ac4c0ca3a488c225cde580ede7dabe874 (patch)
tree17e72042bae3a54e3db9b26cfa490e24ee271c42 /crypto/modes
parent081a7061f3da07318c4b0f5de67b82285630bf6b (diff)
modes: fix coverity 1449860: overlapping memory copy
Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14584) (cherry picked from commit 145f12d12dc83c737676883c625c2a95d34251ed)
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 c85e37c6a5..4595b0f502 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,