Code review feedback

This commit is contained in:
Kareem
2026-06-25 17:42:05 -07:00
parent dba0ba5a07
commit 910daaf658
3 changed files with 6 additions and 3 deletions
+1 -1
View File
@@ -15486,7 +15486,7 @@ int wolfSSL_BUF_MEM_resize(WOLFSSL_BUF_MEM* buf, size_t len)
/* verify provided arguments. The return value is an int, so reject any
* len that cannot be represented as a positive int. */
if (buf == NULL || len == 0 || len > (size_t)INT_MAX) {
if (buf == NULL || len == 0 || len > (size_t)WOLFSSL_MAX_32BIT) {
return 0; /* BAD_FUNC_ARG; */
}
+1 -1
View File
@@ -1758,7 +1758,7 @@ int wolfIO_DecodeUrl(const char* url, int urlSz, char* outName, char* outPath,
/* Reject out-of-range ports rather than silently truncating to
* word16, which would otherwise wrap (e.g. 65536 -> 0) and
* connect to an unintended port. */
if (bigPort > 65535)
if (bigPort > WOLFSSL_MAX_16BIT)
return WOLFSSL_FATAL_ERROR;
if (outPort)
*outPort = (word16)bigPort;
+4 -1
View File
@@ -126,7 +126,10 @@ int wc_ChaCha20Poly1305_Decrypt(
/* zero plaintext on error */
ForceZero(outPlaintext, inCiphertextLen);
}
ForceZero(aead, sizeof(ChaChaPoly_Aead));
#ifdef WOLFSSL_SMALL_STACK
if (aead != NULL)
#endif
ForceZero(aead, sizeof(ChaChaPoly_Aead));
WC_FREE_VAR_EX(aead, NULL, DYNAMIC_TYPE_TMP_BUFFER);
return ret;