From c48b4f2d86145b339fc0eec68daeb430ec406dd1 Mon Sep 17 00:00:00 2001 From: John Bland Date: Mon, 10 Mar 2025 11:11:27 -0400 Subject: [PATCH] add missing echX NULL check --- src/tls.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/tls.c b/src/tls.c index 91acca4d3..edf67d453 100644 --- a/src/tls.c +++ b/src/tls.c @@ -15255,7 +15255,9 @@ static int TLSX_WriteWithEch(WOLFSSL* ssl, byte* output, byte* semaphore, } /* only write if have a shot at acceptance */ - if (ssl->options.echAccepted || ((WOLFSSL_ECH*)echX->data)->innerCount == 0) { + if (echX != NULL && + (ssl->options.echAccepted || + ((WOLFSSL_ECH*)echX->data)->innerCount == 0)) { if (echX != NULL) { /* turn off and write it last */ TURN_OFF(semaphore, TLSX_ToSemaphore(echX->type));