1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

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

This commit is contained in:
Kaspar Schleiser 2019-01-17 10:56:34 +01:00
parent e65a017f19
commit d6390b3685

View File

@ -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;
}