Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion wolfcrypt/test/test.c
Original file line number Diff line number Diff line change
Expand Up @@ -2866,7 +2866,7 @@ static wc_test_ret_t _SaveDerAndPem(const byte* der, int derSz,
WOLFSSL_TEST_SUBROUTINE wc_test_ret_t error_test(void)
{
const char* errStr;
char out[WOLFSSL_MAX_ERROR_SZ];
char out[WOLFSSL_MAX_ERROR_SZ]; /* test fails if too small, < 64 */
const char* unknownStr = wc_GetErrorString(0);

#ifdef NO_ERROR_STRINGS
Expand Down
8 changes: 7 additions & 1 deletion wolfssl/wolfcrypt/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -1199,7 +1199,13 @@ enum {
};

/* max error buffer string size */
#ifndef WOLFSSL_MAX_ERROR_SZ
#ifdef WOLFSSL_MAX_ERROR_SZ
#if WOLFSSL_MAX_ERROR_SZ < 64
/* If too small, the error_test() will fail.
* See fixed length strings returned in wc_GetErrorString() */
#error WOLFSSL_MAX_ERROR_SZ must be at least length of longest message
#endif
#else
#define WOLFSSL_MAX_ERROR_SZ 80
#endif

Expand Down