diff options
author | Christian Heimes <christian@python.org> | 2016-09-08 11:40:25 (GMT) |
---|---|---|
committer | Christian Heimes <christian@python.org> | 2016-09-08 11:40:25 (GMT) |
commit | 5940c535b06805960d008bcafec7260dae74d9b9 (patch) | |
tree | 3aaf6be1691c520b69d68c50d9dd26a14d184182 /Modules/_blake2/impl | |
parent | cf45ee10fba914bd28a379f0c64e4113d2dc46df (diff) | |
download | cpython-5940c535b06805960d008bcafec7260dae74d9b9.zip cpython-5940c535b06805960d008bcafec7260dae74d9b9.tar.gz cpython-5940c535b06805960d008bcafec7260dae74d9b9.tar.bz2 |
Issue #26798: Coverity complains about potential memcpy() of overlapped regions. It doesn't hurt to use memmove() here. CID 1372514 / CID 1372515. Upstream https://github.com/BLAKE2/BLAKE2/issues/32
Diffstat (limited to 'Modules/_blake2/impl')
-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 ec775b4..ab375a4 100644 --- a/Modules/_blake2/impl/blake2b-ref.c +++ b/Modules/_blake2/impl/blake2b-ref.c @@ -334,7 +334,7 @@ int blake2b_final( blake2b_state *S, uint8_t *out, uint8_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 58c79fa..ebb65bb 100644 --- a/Modules/_blake2/impl/blake2b.c +++ b/Modules/_blake2/impl/blake2b.c @@ -371,7 +371,7 @@ int blake2b_final( blake2b_state *S, uint8_t *out, uint8_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 b08e72b..6636753 100644 --- a/Modules/_blake2/impl/blake2s-ref.c +++ b/Modules/_blake2/impl/blake2s-ref.c @@ -325,7 +325,7 @@ int blake2s_final( blake2s_state *S, uint8_t *out, uint8_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 ccad662..69385dc 100644 --- a/Modules/_blake2/impl/blake2s.c +++ b/Modules/_blake2/impl/blake2s.c @@ -348,7 +348,7 @@ int blake2s_final( blake2s_state *S, uint8_t *out, uint8_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 ); |