From b693127dcd895fda2296c56a59c1e77e9cc6f64a Mon Sep 17 00:00:00 2001 From: Daniel Pouzzner Date: Fri, 16 Aug 2024 17:24:34 +0200 Subject: [PATCH] Analyzer fixes --- src/ssl_asn1.c | 6 +++--- src/x509.c | 2 +- wolfssl/openssl/asn1.h | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/ssl_asn1.c b/src/ssl_asn1.c index b083d02f7c..b3a0ef3ef9 100644 --- a/src/ssl_asn1.c +++ b/src/ssl_asn1.c @@ -151,7 +151,7 @@ static void asn1_free_tpl(void *obj, const WOLFSSL_ASN1_TEMPLATE *mem) { if (obj != NULL) { if (mem->sequence) - wolfSSL_sk_pop_free(obj, mem->free_func); + wolfSSL_sk_pop_free((WOLFSSL_STACK *)obj, mem->free_func); else mem->free_func(obj); } @@ -201,9 +201,9 @@ static int i2d_asn1_items(const void* obj, byte** buf, const WOLFSSL_ASN1_TEMPLATE* mem) { int len = 0; - int ret; + int ret = 0; if (mem->sequence) { - const WOLFSSL_STACK* sk = asn1Mem(obj, mem->offset); + const WOLFSSL_STACK* sk = (WOLFSSL_STACK *)asn1Mem(obj, mem->offset); int ski; /* stack index */ int innerLen = 0; /* Figure out the inner length first */ diff --git a/src/x509.c b/src/x509.c index 51d3c241e8..b16642d4ff 100644 --- a/src/x509.c +++ b/src/x509.c @@ -13350,7 +13350,7 @@ WOLFSSL_X509_OBJECT *wolfSSL_X509_OBJECT_retrieve_by_subject( return NULL; for (i = 0; i < wolfSSL_sk_X509_OBJECT_num(sk); i++) { - WOLFSSL_X509_OBJECT* obj = wolfSSL_sk_X509_OBJECT_value(sk, i); + WOLFSSL_X509_OBJECT* obj = (WOLFSSL_X509_OBJECT *)wolfSSL_sk_X509_OBJECT_value(sk, i); if (obj != NULL && obj->type == type && wolfSSL_X509_NAME_cmp( wolfSSL_X509_get_subject_name(obj->data.x509), name) == 0) diff --git a/wolfssl/openssl/asn1.h b/wolfssl/openssl/asn1.h index b2ff24b1e2..45cc298992 100644 --- a/wolfssl/openssl/asn1.h +++ b/wolfssl/openssl/asn1.h @@ -301,7 +301,7 @@ WOLFSSL_API void* wolfSSL_ASN1_item_d2i(void** dst, const byte **src, long len, type* d2i_##type(type **dst, const byte **src, long len); \ type* d2i_##type(type **dst, const byte **src, long len) \ { \ - return wolfSSL_ASN1_item_d2i((void**)dst, src, len, \ + return (type*)wolfSSL_ASN1_item_d2i((void**)dst, src, len, \ &type##_template_data); \ } /* // NOLINTEND(readability-named-parameter) */