From 0a928208f27c58ad02d3a42c3e7d7d2820f9ac85 Mon Sep 17 00:00:00 2001 From: Eric Blankenhorn Date: Wed, 22 Feb 2023 08:19:11 -0600 Subject: [PATCH] Fix NULL dereference in TLSX_CSR_Parse --- src/tls.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/tls.c b/src/tls.c index 18df7474b..5265a9a67 100644 --- a/src/tls.c +++ b/src/tls.c @@ -3218,6 +3218,10 @@ static int TLSX_CSR_Parse(WOLFSSL* ssl, const byte* input, word16 length, #if defined(WOLFSSL_TLS13) if (ssl->options.tls1_3) { + if (ssl->buffers.certificate == NULL) { + WOLFSSL_MSG("Certificate buffer not set!"); + return BUFFER_ERROR; + } cert = (DecodedCert*)XMALLOC(sizeof(DecodedCert), ssl->heap, DYNAMIC_TYPE_DCERT); if (cert == NULL) {