additional sanity check on input arguments

This commit is contained in:
JacobBarthelmeh
2026-06-16 14:48:35 -06:00
parent 45895076bc
commit 42d0bb3193
2 changed files with 13 additions and 1 deletions
+12
View File
@@ -385,6 +385,18 @@ int test_wolfSSL_EVP_DecodeUpdate(void)
);
ExpectIntEQ( outl, 0);
/* pass negative length */
ExpectIntEQ(
EVP_DecodeUpdate(
ctx,
decOutBuff,
&outl,
enc1,
-1), /* negative inl */
-1 /* expected result code -1: fail */
);
ExpectIntEQ( outl, 0);
ExpectIntEQ(EVP_DecodeBlock(NULL, NULL, 0), -1);
/* pass zero length input */
+1 -1
View File
@@ -13457,7 +13457,7 @@ int wolfSSL_EVP_DecodeUpdate(WOLFSSL_EVP_ENCODE_CTX* ctx,
if (outl == NULL)
return -1;
if (ctx == NULL || out == NULL || in == NULL) {
if (ctx == NULL || out == NULL || in == NULL || inl < 0) {
*outl = 0;
return -1;
}