diff options
| author | inoguchi <> | 2022-01-22 00:45:17 +0000 |
|---|---|---|
| committer | inoguchi <> | 2022-01-22 00:45:17 +0000 |
| commit | 6f0157a09a68457e1f94fb74b95dc4308048d41c (patch) | |
| tree | b8c58d811febd72f85c01bdc4618ee0be4e4da2a | |
| parent | a1bf0e94d1d1be83c314efb2e94ca9dfabffae16 (diff) | |
| download | openbsd-6f0157a09a68457e1f94fb74b95dc4308048d41c.tar.gz openbsd-6f0157a09a68457e1f94fb74b95dc4308048d41c.tar.bz2 openbsd-6f0157a09a68457e1f94fb74b95dc4308048d41c.zip | |
Use memmove instead of memcpy for overlapping memory
CID 251047 251094
OK beck@ jsing@ millert@ tb@
| -rw-r--r-- | src/lib/libcrypto/modes/cbc128.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/lib/libcrypto/modes/cbc128.c b/src/lib/libcrypto/modes/cbc128.c index fe45103b0c..c5cf5a632d 100644 --- a/src/lib/libcrypto/modes/cbc128.c +++ b/src/lib/libcrypto/modes/cbc128.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: cbc128.c,v 1.4 2015/02/10 09:46:30 miod Exp $ */ | 1 | /* $OpenBSD: cbc128.c,v 1.5 2022/01/22 00:45:17 inoguchi Exp $ */ |
| 2 | /* ==================================================================== | 2 | /* ==================================================================== |
| 3 | * Copyright (c) 2008 The OpenSSL Project. All rights reserved. | 3 | * Copyright (c) 2008 The OpenSSL Project. All rights reserved. |
| 4 | * | 4 | * |
| @@ -110,7 +110,7 @@ void CRYPTO_cbc128_encrypt(const unsigned char *in, unsigned char *out, | |||
| 110 | in += 16; | 110 | in += 16; |
| 111 | out += 16; | 111 | out += 16; |
| 112 | } | 112 | } |
| 113 | memcpy(ivec,iv,16); | 113 | memmove(ivec,iv,16); |
| 114 | } | 114 | } |
| 115 | 115 | ||
| 116 | void CRYPTO_cbc128_decrypt(const unsigned char *in, unsigned char *out, | 116 | void CRYPTO_cbc128_decrypt(const unsigned char *in, unsigned char *out, |
| @@ -148,7 +148,7 @@ void CRYPTO_cbc128_decrypt(const unsigned char *in, unsigned char *out, | |||
| 148 | out += 16; | 148 | out += 16; |
| 149 | } | 149 | } |
| 150 | } | 150 | } |
| 151 | memcpy(ivec,iv,16); | 151 | memmove(ivec,iv,16); |
| 152 | } else { | 152 | } else { |
| 153 | if (STRICT_ALIGNMENT && | 153 | if (STRICT_ALIGNMENT && |
| 154 | ((size_t)in|(size_t)out|(size_t)ivec)%sizeof(size_t) != 0) { | 154 | ((size_t)in|(size_t)out|(size_t)ivec)%sizeof(size_t) != 0) { |
