From 512f9286504106791662539852f2fea059699ed9 Mon Sep 17 00:00:00 2001 From: David Garske Date: Wed, 26 Feb 2025 14:45:23 -0800 Subject: [PATCH] Fix cast warnings with g++. --- src/ocsp.c | 3 ++- tests/api/test_ocsp.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/ocsp.c b/src/ocsp.c index 5794691bb..88d75f365 100644 --- a/src/ocsp.c +++ b/src/ocsp.c @@ -1481,7 +1481,8 @@ WOLFSSL_OCSP_CERTID* wolfSSL_d2i_OCSP_CERTID(WOLFSSL_OCSP_CERTID** cidOut, } XMEMSET(cid, 0, sizeof(WOLFSSL_OCSP_CERTID)); - cid->status = XMALLOC(sizeof(CertStatus), NULL, DYNAMIC_TYPE_OCSP_STATUS); + cid->status = (CertStatus*)XMALLOC(sizeof(CertStatus), NULL, + DYNAMIC_TYPE_OCSP_STATUS); if (cid->status == NULL) { XFREE(cid, NULL, DYNAMIC_TYPE_OPENSSL); return NULL; diff --git a/tests/api/test_ocsp.c b/tests/api/test_ocsp.c index ca2cdc208..b315ee6b5 100644 --- a/tests/api/test_ocsp.c +++ b/tests/api/test_ocsp.c @@ -623,7 +623,7 @@ int test_ocsp_certid_enc_dec(void) ExpectIntGT(derSz1 = wolfSSL_i2d_OCSP_CERTID(certId, &der), 0); ExpectIntEQ(derSz, derSz1); - temp = der2 = XMALLOC(derSz, NULL, DYNAMIC_TYPE_OPENSSL); + temp = der2 = (unsigned char*)XMALLOC(derSz, NULL, DYNAMIC_TYPE_OPENSSL); ExpectNotNull(der2); /* encode without allocation */ ExpectIntGT(derSz1 = wolfSSL_i2d_OCSP_CERTID(certId, &der2), 0);