Check ssl->arrays in SendClientHello to avoid null dereference. Allow building with fallthrough defined.

This commit is contained in:
Kareem
2021-11-17 13:54:02 -07:00
parent c3500fa24e
commit 930e1ac473
2 changed files with 6 additions and 1 deletions

View File

@ -22666,6 +22666,10 @@ exit_dpk:
WOLFSSL_START(WC_FUNC_CLIENT_HELLO_SEND);
WOLFSSL_ENTER("SendClientHello");
if (ssl == NULL || ssl->arrays == NULL) {
return BAD_FUNC_ARG;
}
if (ssl->suites == NULL) {
WOLFSSL_MSG("Bad suites pointer in SendClientHello");
return SUITES_ERROR;

View File

@ -315,7 +315,8 @@ decouple library dependencies with standard string, memory and so on.
#if defined(WOLFSSL_LINUXKM) && defined(fallthrough)
#define FALL_THROUGH fallthrough
#else
#define FALL_THROUGH ; __attribute__ ((fallthrough))
/* Use __ notation to avoid conflicts */
#define FALL_THROUGH ; __attribute__ ((__fallthrough__))
#endif
#endif
#endif