add missing echX NULL check

pull/6805/head
John Bland 2025-03-10 11:11:27 -04:00
parent 9b65bc22f1
commit c48b4f2d86
1 changed files with 3 additions and 1 deletions

View File

@ -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));