Skip to content

Commit a5bc0cd

Browse files
authored
Merge pull request #9887 from rlm2002/static_analysis
20260305 Coverity fixes
2 parents fc7c19b + 2e1a2b9 commit a5bc0cd

2 files changed

Lines changed: 1 addition & 3 deletions

File tree

wolfcrypt/src/pkcs7.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5693,7 +5693,6 @@ static int wc_PKCS7_HandleOctetStrings(wc_PKCS7* pkcs7, byte* in, word32 inSz,
56935693
WOLFSSL_MSG("failed to grow content buffer.");
56945694
if (tempBuf != NULL) {
56955695
XFREE(tempBuf, pkcs7->heap, DYNAMIC_TYPE_PKCS7);
5696-
tempBuf = NULL;
56975696
}
56985697
ret = MEMORY_E;
56995698
break;
@@ -5707,7 +5706,6 @@ static int wc_PKCS7_HandleOctetStrings(wc_PKCS7* pkcs7, byte* in, word32 inSz,
57075706
pkcs7->stream->expected);
57085707
if (tempBuf != NULL) {
57095708
XFREE(tempBuf, pkcs7->heap, DYNAMIC_TYPE_PKCS7);
5710-
tempBuf = NULL;
57115709
}
57125710
}
57135711
}

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)