Skip to content

Commit

Permalink
Fix wolfSSL_X509_STORE_get0_objects to handle case where no CA has be…
Browse files Browse the repository at this point in the history
…en loaded
  • Loading branch information
ColtonWilley committed Nov 25, 2024
1 parent 71abfa3 commit 5460ba8
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/x509_str.c
Original file line number Diff line number Diff line change
Expand Up @@ -1850,6 +1850,13 @@ WOLF_STACK_OF(WOLFSSL_X509_OBJECT)* wolfSSL_X509_STORE_get0_objects(
#if defined(WOLFSSL_SIGNER_DER_CERT) && !defined(NO_FILESYSTEM)
cert_stack = wolfSSL_CertManagerGetCerts(store->cm);
store->numAdded = 0;
if (cert_stack == NULL && wolfSSL_sk_X509_num(store->certs) > 0) {
cert_stack = wolfSSL_sk_X509_new_null();
if (cert_stack == NULL) {
WOLFSSL_MSG("wolfSSL_sk_X509_OBJECT_new error");
goto err_cleanup;
}
}
for (i = 0; i < wolfSSL_sk_X509_num(store->certs); i++) {
if (wolfSSL_sk_X509_push(cert_stack,
wolfSSL_sk_X509_value(store->certs, i)) > 0) {
Expand Down

0 comments on commit 5460ba8

Please sign in to comment.