Skip to content

Commit 6de2557

Browse files
committed
check buflen is less than BLAKE2B_BLOCKBYTES * 2
1 parent 7b7c658 commit 6de2557

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

wolfcrypt/src/blake2b.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,8 @@ int blake2b_final( blake2b_state *S, byte *out, byte outlen )
356356
}
357357

358358
S->buflen -= BLAKE2B_BLOCKBYTES;
359+
if ( S->buflen >= (BLAKE2B_BLOCKBYTES * 2) )
360+
return BAD_LENGTH_E;
359361
XMEMCPY( S->buf, S->buf + BLAKE2B_BLOCKBYTES, (wolfssl_word)S->buflen );
360362
}
361363

0 commit comments

Comments
 (0)