Skip to content
Snippets Groups Projects
Commit d6390b36 authored by Kaspar Schleiser's avatar Kaspar Schleiser
Browse files

hashes/sha256: don't call memcpy if len==0

parent e65a017f
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