Restore a test case. Add a missing null-check.

This commit is contained in:
John Safranek
2021-10-22 10:36:17 -07:00
parent 79b738b5a6
commit aad230a7e3
2 changed files with 6 additions and 1 deletions

View File

@ -8050,7 +8050,7 @@ static WOLFSSL_EVP_PKEY* d2iGenericKey(WOLFSSL_EVP_PKEY** out,
WOLFSSL_ENTER("d2iGenericKey");
if (in == NULL || inSz < 0) {
if (in == NULL || *in == NULL || inSz < 0) {
WOLFSSL_MSG("Bad argument");
return NULL;
}

View File

@ -49648,6 +49648,11 @@ static void test_wolfSSL_ERR_strings(void)
err = wolfSSL_ERR_func_error_string(UNSUPPORTED_SUITE);
AssertTrue(err != NULL);
AssertIntEQ((*err == '\0'), 1);
/* The value -MIN_CODE_E+2 is PEM_R_PROBLEMS_GETTING_PASSWORD. */
err = wolfSSL_ERR_lib_error_string(-MIN_CODE_E+2);
AssertTrue(err != NULL);
AssertIntEQ((*err == '\0'), 1);
#endif
printf(resultFmt, passed);
#endif