Skip to content

Commit 3c00e26

Browse files
authored
Merge pull request #8974 from rlm2002/coverity_fix
Coverity: Check values
2 parents e37082e + 6de2557 commit 3c00e26

3 files changed

Lines changed: 8 additions & 0 deletions

File tree

src/dtls.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -678,6 +678,8 @@ static int SendStatelessReplyDtls13(const WOLFSSL* ssl, WolfSSL_CH* ch)
678678
ERROR_OUT(BUFFER_ERROR, dtls13_cleanup);
679679
if ((sigAlgs.size % 2) != 0)
680680
ERROR_OUT(BUFFER_ERROR, dtls13_cleanup);
681+
if (sigAlgs.size > WOLFSSL_MAX_SIGALGO)
682+
ERROR_OUT(BUFFER_ERROR, dtls13_cleanup);
681683
suites.hashSigAlgoSz = (word16)sigAlgs.size;
682684
XMEMCPY(suites.hashSigAlgo, sigAlgs.elements, sigAlgs.size);
683685
haveSA = 1;

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

wolfcrypt/src/des3.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1727,6 +1727,10 @@
17271727
{
17281728
word32 blocks = sz / DES_BLOCK_SIZE;
17291729

1730+
if (des == NULL || out == NULL || in == NULL) {
1731+
return BAD_FUNC_ARG;
1732+
}
1733+
17301734
while (blocks--) {
17311735
xorbuf((byte*)des->reg, in, DES_BLOCK_SIZE);
17321736
DesProcessBlock(des, (byte*)des->reg, (byte*)des->reg);

0 commit comments

Comments
 (0)