From af518f8c86c85c52c3aeae89697add9ba1f0367c Mon Sep 17 00:00:00 2001 From: JacobBarthelmeh Date: Mon, 17 Oct 2022 08:55:41 -0700 Subject: [PATCH] adjust saving new OCSP cert --- src/ocsp.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ocsp.c b/src/ocsp.c index d18e5739d..5d021bc13 100644 --- a/src/ocsp.c +++ b/src/ocsp.c @@ -327,6 +327,8 @@ int CheckOcspResponse(WOLFSSL_OCSP *ocsp, byte *response, int responseSz, goto end; } if (ocspRequest != NULL) { + /* Has the chance to bubble up response changing ocspResponse->single to + no longer be pointing at newSingle */ ret = CompareOcspReqResp(ocspRequest, ocspResponse); if (ret != 0) { goto end; @@ -368,7 +370,7 @@ int CheckOcspResponse(WOLFSSL_OCSP *ocsp, byte *response, int responseSz, status = (CertStatus*)XMALLOC(sizeof(CertStatus), ocsp->cm->heap, DYNAMIC_TYPE_OCSP_STATUS); if (status != NULL) { - XMEMCPY(status, newSingle->status, sizeof(CertStatus)); + XMEMCPY(status, ocspResponse->single->status, sizeof(CertStatus)); status->next = entry->status; entry->status = status; entry->ownStatus = 1;