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;