Skip to content

Commit

Permalink
Merge pull request wolfSSL#8096 from philljj/fix_coverity_more
Browse files Browse the repository at this point in the history
Fix more coverity errors.
  • Loading branch information
douzzer authored Oct 22, 2024
2 parents f8fc31e + 5fd9e99 commit 846ef15
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/x509.c
Original file line number Diff line number Diff line change
Expand Up @@ -2445,6 +2445,7 @@ void* wolfSSL_X509_get_ext_d2i(const WOLFSSL_X509* x509, int nid, int* c,
sk = NULL;
}
}

obj = wolfSSL_ASN1_OBJECT_new();
if (obj == NULL) {
WOLFSSL_MSG("Issue creating WOLFSSL_ASN1_OBJECT struct");
Expand All @@ -2455,6 +2456,15 @@ void* wolfSSL_X509_get_ext_d2i(const WOLFSSL_X509* x509, int nid, int* c,
obj->grp = oidCertExtType;
obj->obj = (byte*)(x509->certPolicies[i]);
obj->objSz = MAX_CERTPOL_SZ;

if (wolfSSL_sk_ASN1_OBJECT_push(sk, obj) <= 0) {
WOLFSSL_MSG("Error pushing ASN1 object onto stack");
wolfSSL_ASN1_OBJECT_free(obj);
wolfSSL_sk_ASN1_OBJECT_pop_free(sk, NULL);
sk = NULL;
}

obj = NULL;
}
else {
WOLFSSL_MSG("No Cert Policy set");
Expand Down

0 comments on commit 846ef15

Please sign in to comment.