diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2021-03-30 04:36:39 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-30 04:36:39 (GMT) |
commit | 05429c917c23f735b07ac4c60af20e57aad742fc (patch) | |
tree | 6a7941006701864750b4d205cae4c0733448662f | |
parent | ff4715a7332123713de9920e724bb6c412d8ccef (diff) | |
download | cpython-05429c917c23f735b07ac4c60af20e57aad742fc.zip cpython-05429c917c23f735b07ac4c60af20e57aad742fc.tar.gz cpython-05429c917c23f735b07ac4c60af20e57aad742fc.tar.bz2 |
bpo-33164: blake2: Fix Coverity scan (GH-25060)
(cherry picked from commit 068ebf9729d440cef03e4c57e3db83c851146172)
Co-authored-by: Inada Naoki <songofacandy@gmail.com>
-rw-r--r-- | Modules/_blake2/impl/blake2b-ref.c | 2 | ||||
-rw-r--r-- | Modules/_blake2/impl/blake2b.c | 2 | ||||
-rw-r--r-- | Modules/_blake2/impl/blake2s-ref.c | 2 | ||||
-rw-r--r-- | Modules/_blake2/impl/blake2s.c | 2 |
4 files changed, 4 insertions, 4 deletions
diff --git a/Modules/_blake2/impl/blake2b-ref.c b/Modules/_blake2/impl/blake2b-ref.c index 699f1a1..e58c436 100644 --- a/Modules/_blake2/impl/blake2b-ref.c +++ b/Modules/_blake2/impl/blake2b-ref.c @@ -333,7 +333,7 @@ int blake2b_final( blake2b_state *S, uint8_t *out, size_t outlen ) blake2b_increment_counter( S, BLAKE2B_BLOCKBYTES ); blake2b_compress( S, S->buf ); S->buflen -= BLAKE2B_BLOCKBYTES; - memcpy( S->buf, S->buf + BLAKE2B_BLOCKBYTES, S->buflen ); + memmove( S->buf, S->buf + BLAKE2B_BLOCKBYTES, S->buflen ); } blake2b_increment_counter( S, S->buflen ); diff --git a/Modules/_blake2/impl/blake2b.c b/Modules/_blake2/impl/blake2b.c index 3d3e465..c1068e8 100644 --- a/Modules/_blake2/impl/blake2b.c +++ b/Modules/_blake2/impl/blake2b.c @@ -388,7 +388,7 @@ int blake2b_final( blake2b_state *S, uint8_t *out, size_t outlen ) blake2b_increment_counter( S, BLAKE2B_BLOCKBYTES ); blake2b_compress( S, S->buf ); S->buflen -= BLAKE2B_BLOCKBYTES; - memcpy( S->buf, S->buf + BLAKE2B_BLOCKBYTES, S->buflen ); + memmove( S->buf, S->buf + BLAKE2B_BLOCKBYTES, S->buflen ); } blake2b_increment_counter( S, S->buflen ); diff --git a/Modules/_blake2/impl/blake2s-ref.c b/Modules/_blake2/impl/blake2s-ref.c index baf0b58..ab86cc1 100644 --- a/Modules/_blake2/impl/blake2s-ref.c +++ b/Modules/_blake2/impl/blake2s-ref.c @@ -323,7 +323,7 @@ int blake2s_final( blake2s_state *S, uint8_t *out, size_t outlen ) blake2s_increment_counter( S, BLAKE2S_BLOCKBYTES ); blake2s_compress( S, S->buf ); S->buflen -= BLAKE2S_BLOCKBYTES; - memcpy( S->buf, S->buf + BLAKE2S_BLOCKBYTES, S->buflen ); + memmove( S->buf, S->buf + BLAKE2S_BLOCKBYTES, S->buflen ); } blake2s_increment_counter( S, ( uint32_t )S->buflen ); diff --git a/Modules/_blake2/impl/blake2s.c b/Modules/_blake2/impl/blake2s.c index 3a04328..4751468 100644 --- a/Modules/_blake2/impl/blake2s.c +++ b/Modules/_blake2/impl/blake2s.c @@ -363,7 +363,7 @@ int blake2s_final( blake2s_state *S, uint8_t *out, size_t outlen ) blake2s_increment_counter( S, BLAKE2S_BLOCKBYTES ); blake2s_compress( S, S->buf ); S->buflen -= BLAKE2S_BLOCKBYTES; - memcpy( S->buf, S->buf + BLAKE2S_BLOCKBYTES, S->buflen ); + memmove( S->buf, S->buf + BLAKE2S_BLOCKBYTES, S->buflen ); } blake2s_increment_counter( S, ( uint32_t )S->buflen ); |