Analyzer fixes

This commit is contained in:
Daniel Pouzzner
2024-08-16 17:24:34 +02:00
committed by Juliusz Sosinowicz
parent a6a40de249
commit b693127dcd
3 changed files with 5 additions and 5 deletions

View File

@ -151,7 +151,7 @@ static void asn1_free_tpl(void *obj, const WOLFSSL_ASN1_TEMPLATE *mem)
{ {
if (obj != NULL) { if (obj != NULL) {
if (mem->sequence) if (mem->sequence)
wolfSSL_sk_pop_free(obj, mem->free_func); wolfSSL_sk_pop_free((WOLFSSL_STACK *)obj, mem->free_func);
else else
mem->free_func(obj); mem->free_func(obj);
} }
@ -201,9 +201,9 @@ static int i2d_asn1_items(const void* obj, byte** buf,
const WOLFSSL_ASN1_TEMPLATE* mem) const WOLFSSL_ASN1_TEMPLATE* mem)
{ {
int len = 0; int len = 0;
int ret; int ret = 0;
if (mem->sequence) { 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 ski; /* stack index */
int innerLen = 0; int innerLen = 0;
/* Figure out the inner length first */ /* Figure out the inner length first */

View File

@ -13350,7 +13350,7 @@ WOLFSSL_X509_OBJECT *wolfSSL_X509_OBJECT_retrieve_by_subject(
return NULL; return NULL;
for (i = 0; i < wolfSSL_sk_X509_OBJECT_num(sk); i++) { 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 && if (obj != NULL && obj->type == type &&
wolfSSL_X509_NAME_cmp( wolfSSL_X509_NAME_cmp(
wolfSSL_X509_get_subject_name(obj->data.x509), name) == 0) wolfSSL_X509_get_subject_name(obj->data.x509), name) == 0)

View File

@ -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); \
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); \ &type##_template_data); \
} }
/* // NOLINTEND(readability-named-parameter) */ /* // NOLINTEND(readability-named-parameter) */