From 75e38c360fc26bb9f4f0d3ad739e9d94f57d95fd Mon Sep 17 00:00:00 2001 From: Kareem Date: Thu, 7 May 2026 15:57:47 -0700 Subject: [PATCH] NULL check wolfSSL_get_cipher_name_by_hash arguments. Thanks to Cal Page for the report. --- src/tls13.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/tls13.c b/src/tls13.c index ca62390c81..35f1e4dd15 100644 --- a/src/tls13.c +++ b/src/tls13.c @@ -15147,7 +15147,15 @@ const char* wolfSSL_get_cipher_name_by_hash(WOLFSSL* ssl, const char* hash) const char* name = NULL; byte mac = no_mac; int i; - const Suites* suites = WOLFSSL_SUITES(ssl); + const Suites* suites; + + if (hash == NULL || ssl == NULL || + (ssl->suites == NULL && ssl->ctx == NULL)) + return NULL; + + suites = WOLFSSL_SUITES(ssl); + if (suites == NULL) + return NULL; if (XSTRCMP(hash, "SHA256") == 0) { mac = sha256_mac;