CMS_get0_SignerInfos(): Prevent spurious error on cms_get0_signed() failure

Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/12959)
master
Dr. David von Oheimb 2 years ago committed by Dr. David von Oheimb
parent 1b96cc70eb
commit 8a734d3aaf

@ -496,9 +496,13 @@ void ossl_cms_SignerInfos_set_cmsctx(CMS_ContentInfo *cms)
{
int i;
CMS_SignerInfo *si;
STACK_OF(CMS_SignerInfo) *sinfos = CMS_get0_SignerInfos(cms);
STACK_OF(CMS_SignerInfo) *sinfos;
const CMS_CTX *ctx = ossl_cms_get0_cmsctx(cms);
ERR_set_mark();
sinfos = CMS_get0_SignerInfos(cms);
ERR_pop_to_mark(); /* removes error in case sinfos == NULL */
for (i = 0; i < sk_CMS_SignerInfo_num(sinfos); i++) {
si = sk_CMS_SignerInfo_value(sinfos, i);
if (si != NULL)

Loading…
Cancel
Save