Merge pull request #6120 from embhorn/zd15698

Fix NULL dereference in TLSX_CSR_Parse
This commit is contained in:
David Garske
2023-02-22 13:43:43 -08:00
committed by GitHub

View File

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