Skip to content

Commit eeb34a7

Browse files
NULL check wolfSSL_get_cipher_name_by_hash arguments.
Thanks to Cal Page for the report.
1 parent 3796191 commit eeb34a7

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

src/tls13.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15147,7 +15147,15 @@ const char* wolfSSL_get_cipher_name_by_hash(WOLFSSL* ssl, const char* hash)
1514715147
const char* name = NULL;
1514815148
byte mac = no_mac;
1514915149
int i;
15150-
const Suites* suites = WOLFSSL_SUITES(ssl);
15150+
const Suites* suites;
15151+
15152+
if (hash == NULL || ssl == NULL ||
15153+
(ssl->suites == NULL && ssl->ctx == NULL))
15154+
return NULL;
15155+
15156+
suites = WOLFSSL_SUITES(ssl);
15157+
if (suites == NULL)
15158+
return NULL;
1515115159

1515215160
if (XSTRCMP(hash, "SHA256") == 0) {
1515315161
mac = sha256_mac;

0 commit comments

Comments
 (0)