summaryrefslogtreecommitdiff
path: root/lib/libcrypto
diff options
context:
space:
mode:
authorKinichiro Inoguchi <inoguchi@cvs.openbsd.org>2022-01-22 00:43:42 +0000
committerKinichiro Inoguchi <inoguchi@cvs.openbsd.org>2022-01-22 00:43:42 +0000
commitb91a85299a6645884163428cdef7a6a44298e889 (patch)
treef1b4e5494a2e3cede577586722c686954ab0c8ca /lib/libcrypto
parentf1f55b3fb15619f7c6e27a784353ea2b6c399fd2 (diff)
Use memmove instead of memcpy for overlapping memory
CID 250936 251103 OK beck@ jsing@ millert@ tb@
Diffstat (limited to 'lib/libcrypto')
-rw-r--r--lib/libcrypto/aes/aes_ige.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/libcrypto/aes/aes_ige.c b/lib/libcrypto/aes/aes_ige.c
index 16ef5612eb7..244a5a36bd6 100644
--- a/lib/libcrypto/aes/aes_ige.c
+++ b/lib/libcrypto/aes/aes_ige.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: aes_ige.c,v 1.7 2015/02/10 09:46:30 miod Exp $ */
+/* $OpenBSD: aes_ige.c,v 1.8 2022/01/22 00:43:41 inoguchi Exp $ */
/* ====================================================================
* Copyright (c) 2006 The OpenSSL Project. All rights reserved.
*
@@ -109,8 +109,8 @@ AES_ige_encrypt(const unsigned char *in, unsigned char *out, size_t length,
in += AES_BLOCK_SIZE;
out += AES_BLOCK_SIZE;
}
- memcpy(ivec, ivp->data, AES_BLOCK_SIZE);
- memcpy(ivec + AES_BLOCK_SIZE, iv2p->data, AES_BLOCK_SIZE);
+ memmove(ivec, ivp->data, AES_BLOCK_SIZE);
+ memmove(ivec + AES_BLOCK_SIZE, iv2p->data, AES_BLOCK_SIZE);
} else {
aes_block_t tmp, tmp2;
aes_block_t iv;
@@ -161,8 +161,8 @@ AES_ige_encrypt(const unsigned char *in, unsigned char *out, size_t length,
in += AES_BLOCK_SIZE;
out += AES_BLOCK_SIZE;
}
- memcpy(ivec, ivp->data, AES_BLOCK_SIZE);
- memcpy(ivec + AES_BLOCK_SIZE, iv2p->data, AES_BLOCK_SIZE);
+ memmove(ivec, ivp->data, AES_BLOCK_SIZE);
+ memmove(ivec + AES_BLOCK_SIZE, iv2p->data, AES_BLOCK_SIZE);
} else {
aes_block_t tmp, tmp2;
aes_block_t iv;