]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
CMS_get1_crls(): Remove redundant check for NULL crls
authorTomas Mraz <tomas@openssl.org>
Thu, 18 Jul 2024 08:11:05 +0000 (10:11 +0200)
committerTomas Mraz <tomas@openssl.org>
Wed, 31 Jul 2024 13:58:24 +0000 (15:58 +0200)
Fixes Coverity 1610380

Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/24928)

crypto/cms/cms_lib.c

index b09985ad3e27fe58effbfbb3c47250b520cc919f..e6a41a1df0db1d8341d40a65ca69b623757af124 100644 (file)
@@ -665,10 +665,6 @@ STACK_OF(X509_CRL) *CMS_get1_crls(CMS_ContentInfo *cms)
     for (i = 0; i < n; i++) {
         rch = sk_CMS_RevocationInfoChoice_value(*pcrls, i);
         if (rch->type == 0) {
-            if (crls == NULL) {
-                if ((crls = sk_X509_CRL_new_null()) == NULL)
-                    return NULL;
-            }
             if (!sk_X509_CRL_push(crls, rch->d.crl)
                     || !X509_CRL_up_ref(rch->d.crl)) {
                 sk_X509_CRL_pop_free(crls, X509_CRL_free);