Merge pull request #7106 from bandi13/20231114-codesonar-fixes

20231114 codesonar fixes
This commit is contained in:
Sean Parkinson
2024-01-04 07:16:33 +10:00
committed by GitHub
5 changed files with 16 additions and 3 deletions

View File

@@ -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,

View File

@@ -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;
}