Skip to content

Commit

Permalink
sha256.h: fix a buglet tiggered by empty augmented message.
Browse files Browse the repository at this point in the history
Reported by Guido Vranken.
  • Loading branch information
dot-asm committed Mar 7, 2021
1 parent 5ca026c commit 02d63da
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/sha256.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ static void sha256_update(SHA256_CTX *ctx, const void *_inp, size_t len)

ctx->N += len;

if ((n = ctx->off) != 0) {
if ((len != 0) & ((n = ctx->off) != 0)) {
size_t rem = sizeof(ctx->buf) - n;

if (rem > len) {
Expand Down

0 comments on commit 02d63da

Please sign in to comment.