Skip to content
Snippets Groups Projects
Unverified Commit b6eb12c6 authored by Martine Lenders's avatar Martine Lenders Committed by GitHub
Browse files

Merge pull request #10795 from kaspar030/fix_sha256_update_with_zero_length

hashes/sha256: don't call memcpy if len==0
parents aef03e62 d6390b36
No related branches found
No related tags found
No related merge requests found
......@@ -223,7 +223,9 @@ void sha256_update(sha256_context_t *ctx, const void *data, size_t len)
/* Handle the case where we don't need to perform any transforms */
if (len < 64 - r) {
memcpy(&ctx->buf[r], data, len);
if (len > 0) {
memcpy(&ctx->buf[r], data, len);
}
return;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment