From 136af03cc3bd916dd27e41b92883c1798deaefe3 Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Mon, 15 Sep 2014 17:45:07 -0700 Subject: [PATCH] blake2b-ref: memcpy() -> memmove() for overlapping regions --- src/libsodium/crypto_generichash/blake2/ref/blake2b-ref.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libsodium/crypto_generichash/blake2/ref/blake2b-ref.c b/src/libsodium/crypto_generichash/blake2/ref/blake2b-ref.c index bd7bc0b8..b07ad228 100644 --- a/src/libsodium/crypto_generichash/blake2/ref/blake2b-ref.c +++ b/src/libsodium/crypto_generichash/blake2/ref/blake2b-ref.c @@ -395,7 +395,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 );