From ae24c81140aec6669c10633ebceefcfee765271b Mon Sep 17 00:00:00 2001 From: inoguchi Date: Sat, 22 Jan 2022 00:45:17 +0000 Subject: [PATCH] Use memmove instead of memcpy for overlapping memory CID 251047 251094 OK beck@ jsing@ millert@ tb@ --- lib/libcrypto/modes/cbc128.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/libcrypto/modes/cbc128.c b/lib/libcrypto/modes/cbc128.c index fe45103b0ca..c5cf5a632d0 100644 --- a/lib/libcrypto/modes/cbc128.c +++ b/lib/libcrypto/modes/cbc128.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cbc128.c,v 1.4 2015/02/10 09:46:30 miod Exp $ */ +/* $OpenBSD: cbc128.c,v 1.5 2022/01/22 00:45:17 inoguchi Exp $ */ /* ==================================================================== * Copyright (c) 2008 The OpenSSL Project. All rights reserved. * @@ -110,7 +110,7 @@ void CRYPTO_cbc128_encrypt(const unsigned char *in, unsigned char *out, in += 16; out += 16; } - memcpy(ivec,iv,16); + memmove(ivec,iv,16); } 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, out += 16; } } - memcpy(ivec,iv,16); + memmove(ivec,iv,16); } else { if (STRICT_ALIGNMENT && ((size_t)in|(size_t)out|(size_t)ivec)%sizeof(size_t) != 0) { -- 2.20.1