Merge pull request #8974 from rlm2002/coverity_fix

Coverity: Check values
This commit is contained in:
David Garske
2025-07-09 16:12:42 -07:00
committed by GitHub
3 changed files with 8 additions and 0 deletions

View File

@ -678,6 +678,8 @@ static int SendStatelessReplyDtls13(const WOLFSSL* ssl, WolfSSL_CH* ch)
ERROR_OUT(BUFFER_ERROR, dtls13_cleanup);
if ((sigAlgs.size % 2) != 0)
ERROR_OUT(BUFFER_ERROR, dtls13_cleanup);
if (sigAlgs.size > WOLFSSL_MAX_SIGALGO)
ERROR_OUT(BUFFER_ERROR, dtls13_cleanup);
suites.hashSigAlgoSz = (word16)sigAlgs.size;
XMEMCPY(suites.hashSigAlgo, sigAlgs.elements, sigAlgs.size);
haveSA = 1;

View File

@ -356,6 +356,8 @@ int blake2b_final( blake2b_state *S, byte *out, byte outlen )
}
S->buflen -= BLAKE2B_BLOCKBYTES;
if ( S->buflen >= (BLAKE2B_BLOCKBYTES * 2) )
return BAD_LENGTH_E;
XMEMCPY( S->buf, S->buf + BLAKE2B_BLOCKBYTES, (wolfssl_word)S->buflen );
}

View File

@ -1727,6 +1727,10 @@
{
word32 blocks = sz / DES_BLOCK_SIZE;
if (des == NULL || out == NULL || in == NULL) {
return BAD_FUNC_ARG;
}
while (blocks--) {
xorbuf((byte*)des->reg, in, DES_BLOCK_SIZE);
DesProcessBlock(des, (byte*)des->reg, (byte*)des->reg);