Merge pull request #2652 from ejohnstown/maintenance-error

Maintenance: Error Strings
This commit is contained in:
David Garske
2019-12-13 15:03:32 -08:00
committed by GitHub
3 changed files with 5 additions and 2 deletions

View File

@@ -521,6 +521,7 @@ const char* wc_GetErrorString(int error)
void wc_ErrorString(int error, char* buffer)
{
XSTRNCPY(buffer, wc_GetErrorString(error), WOLFSSL_MAX_ERROR_SZ);
buffer[WOLFSSL_MAX_ERROR_SZ-1] = 0;
}
#endif /* !NO_ERROR_STRINGS */

View File

@@ -1336,6 +1336,8 @@ int error_test(void)
return -1103;
if (XSTRNCMP(errStr, out, XSTRLEN(errStr)) != 0)
return -1104;
if (XSTRLEN(errStr) >= WOLFSSL_MAX_ERROR_SZ)
return -1109;
}
else {
j++;