Merge pull request #8109 from JacobBarthelmeh/coverity

Recent coverity warnings
pull/8163/head
Daniel Pouzzner 2024-10-23 21:18:44 -05:00 committed by GitHub
commit 3f651a8dd0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 6 deletions

View File

@ -264,7 +264,7 @@ static int X509StoreVerifyCert(WOLFSSL_X509_STORE_CTX* ctx)
WOLFSSL_FILETYPE_ASN1); WOLFSSL_FILETYPE_ASN1);
SetupStoreCtxError(ctx, ret); SetupStoreCtxError(ctx, ret);
#if defined(OPENSSL_ALL) || defined(WOLFSSL_QT) #if defined(OPENSSL_ALL) || defined(WOLFSSL_QT)
if (ctx->store && ctx->store->verify_cb) if (ctx->store->verify_cb)
ret = ctx->store->verify_cb(ret >= 0 ? 1 : 0, ctx) == 1 ? 0 : ret; ret = ctx->store->verify_cb(ret >= 0 ? 1 : 0, ctx) == 1 ? 0 : ret;
#endif #endif
@ -288,7 +288,7 @@ static int X509StoreVerifyCert(WOLFSSL_X509_STORE_CTX* ctx)
} }
SetupStoreCtxError(ctx, ret); SetupStoreCtxError(ctx, ret);
#if defined(OPENSSL_ALL) || defined(WOLFSSL_QT) #if defined(OPENSSL_ALL) || defined(WOLFSSL_QT)
if (ctx->store && ctx->store->verify_cb) if (ctx->store->verify_cb)
ret = ctx->store->verify_cb(ret >= 0 ? 1 : 0, ret = ctx->store->verify_cb(ret >= 0 ? 1 : 0,
ctx) == 1 ? 0 : -1; ctx) == 1 ? 0 : -1;
#endif #endif
@ -1766,10 +1766,9 @@ WOLF_STACK_OF(WOLFSSL_X509_OBJECT)* wolfSSL_X509_STORE_get0_objects(
} }
obj->type = WOLFSSL_X509_LU_X509; obj->type = WOLFSSL_X509_LU_X509;
obj->data.x509 = x509; obj->data.x509 = x509;
x509 = NULL;
} }
while(wolfSSL_sk_X509_num(cert_stack) > 0) { while (wolfSSL_sk_X509_num(cert_stack) > 0) {
wolfSSL_sk_X509_pop(cert_stack); wolfSSL_sk_X509_pop(cert_stack);
} }
#endif #endif
@ -1799,7 +1798,7 @@ err_cleanup:
if (ret != NULL) if (ret != NULL)
X509StoreFreeObjList(store, ret); X509StoreFreeObjList(store, ret);
if (cert_stack != NULL) { if (cert_stack != NULL) {
while(store->numAdded > 0) { while (store->numAdded > 0) {
wolfSSL_sk_X509_pop(cert_stack); wolfSSL_sk_X509_pop(cert_stack);
store->numAdded--; store->numAdded--;
} }