mirror of https://github.com/wolfSSL/wolfssl.git
Merge pull request #7106 from bandi13/20231114-codesonar-fixes
20231114 codesonar fixespull/7111/head
commit
52db533d9b
|
@ -186,6 +186,7 @@ int BuildTlsFinished(WOLFSSL* ssl, Hashes* hashes, const byte* sender)
|
|||
return MEMORY_E;
|
||||
#endif
|
||||
|
||||
XMEMSET(handshake_hash, 0, HSHASH_SZ);
|
||||
ret = BuildTlsHandshakeHash(ssl, handshake_hash, &hashSz);
|
||||
if (ret == 0) {
|
||||
if (XSTRNCMP((const char*)sender, (const char*)kTlsClientStr,
|
||||
|
|
|
@ -11173,7 +11173,7 @@ err:
|
|||
pemSz = (int)(l - i);
|
||||
|
||||
/* check calculated length */
|
||||
if (pemSz > MAX_WOLFSSL_FILE_SIZE || pemSz < 0) {
|
||||
if (pemSz > MAX_WOLFSSL_FILE_SIZE || pemSz <= 0) {
|
||||
WOLFSSL_MSG("PEM_read_X509_ex file size error");
|
||||
return NULL;
|
||||
}
|
||||
|
|
|
@ -10350,6 +10350,9 @@ exit_enc:
|
|||
|
||||
RESET_MULTI_VALUE_STATS_VARS();
|
||||
|
||||
if (ret != 0)
|
||||
goto exit;
|
||||
|
||||
bench_stats_start(&count, &start);
|
||||
do {
|
||||
for (i = 0; i < ntimes; i++) {
|
||||
|
|
|
@ -37602,8 +37602,10 @@ int wc_MIME_parse_headers(char* in, int inLen, MimeHdr** headers)
|
|||
mimeType == MIME_PARAM)) && pos >= 1) {
|
||||
mimeStatus = MIME_BODYVAL;
|
||||
end = pos-1;
|
||||
if (nameAttr != NULL)
|
||||
if (nameAttr != NULL) {
|
||||
XFREE(nameAttr, NULL, DYNAMIC_TYPE_PKCS7);
|
||||
nameAttr = NULL;
|
||||
}
|
||||
ret = wc_MIME_header_strip(curLine, &nameAttr, start, end);
|
||||
if (ret) {
|
||||
goto error;
|
||||
|
|
|
@ -12576,7 +12576,14 @@ int wc_PKCS7_EncodeEncryptedData(PKCS7* pkcs7, byte* output, word32 outputSz)
|
|||
return MEMORY_E;
|
||||
}
|
||||
|
||||
FlattenAttributes(pkcs7, flatAttribs, attribs, attribsCount);
|
||||
ret = FlattenAttributes(pkcs7, flatAttribs, attribs, attribsCount);
|
||||
if (ret != 0) {
|
||||
XFREE(attribs, pkcs7->heap, DYNAMIC_TYPE_PKCS7);
|
||||
XFREE(encryptedContent, pkcs7->heap, DYNAMIC_TYPE_PKCS7);
|
||||
XFREE(plain, pkcs7->heap, DYNAMIC_TYPE_PKCS7);
|
||||
XFREE(flatAttribs, pkcs7->heap, DYNAMIC_TYPE_PKCS7);
|
||||
return ret;
|
||||
}
|
||||
attribsSetSz = SetImplicit(ASN_SET, 1, attribsSz, attribSet);
|
||||
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue