Skip to content

Commit adc7b81

Browse files
committed
check if ripemd->buffLen >= RIPEMD_BLOCK_SZ is true to prevent out of bounds write
1 parent 36328e3 commit adc7b81

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

wolfcrypt/src/ripemd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ int wc_RipeMdFinal(RipeMd* ripemd, byte* hash)
317317
AddLength(ripemd, ripemd->buffLen); /* before adding pads */
318318

319319
/* ensure we have a valid buffer length; */
320-
if (ripemd->buffLen > RIPEMD_BLOCK_SIZE) {
320+
if (ripemd->buffLen >= RIPEMD_BLOCK_SIZE) {
321321
/* exit with error code if there's a bad buffer size in buffLen */
322322
return BAD_STATE_E;
323323
} /* buffLen check */

0 commit comments

Comments
 (0)