Use memmove instead of memcpy.

PR#4036

Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Stephen Henson <steve@openssl.org>
This commit is contained in:
John Foley 2015-09-12 00:11:23 +01:00 committed by Dr. Stephen Henson
parent ce5ae63ab2
commit eac2b837d6

View file

@ -76,7 +76,7 @@ size_t CRYPTO_128_wrap(void *key, const unsigned char *iv,
return 0;
A = B;
t = 1;
memcpy(out + 8, in, inlen);
memmove(out + 8, in, inlen);
if (!iv)
iv = default_iv;
@ -113,7 +113,7 @@ size_t CRYPTO_128_unwrap(void *key, const unsigned char *iv,
A = B;
t = 6 * (inlen >> 3);
memcpy(A, in, 8);
memcpy(out, in + 8, inlen);
memmove(out, in + 8, inlen);
for (j = 0; j < 6; j++) {
R = out + inlen - 8;
for (i = 0; i < inlen; i += 8, t--, R -= 8) {