From e971d198d3c61581a24da040ab6d4421c49c623e Mon Sep 17 00:00:00 2001 From: Kareem Date: Tue, 16 Jun 2026 16:40:50 -0700 Subject: [PATCH] Add a NULL check to refineSuites. Thanks to xiaoshuai for the report. --- src/internal.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/internal.c b/src/internal.c index ba1ff99467..292f5f5de9 100644 --- a/src/internal.c +++ b/src/internal.c @@ -38025,6 +38025,17 @@ static int AddPSKtoPreMasterSecret(WOLFSSL* ssl) word16 i; word16 j; + if (outSuites == NULL) { + WOLFSSL_MSG("refineSuites called with NULL outSuites"); + return; + } + + if (sslSuites == NULL || peerSuites == NULL) { + WOLFSSL_MSG("refineSuites called with NULL suite list"); + outSuites->suiteSz = 0; + return; + } + XMEMSET(suites, 0, sizeof(suites)); if (!useClientOrder) {