RT3053: Check for NULL before dereferencing

Reviewed-by: Tim Hudson <tjh@openssl.org>
This commit is contained in:
Phillip Hellewell 2016-06-11 20:04:21 -04:00 committed by Rich Salz
parent 6d6e8070c2
commit 6b3602882e

View file

@ -345,6 +345,8 @@ static STACK_OF(CMS_CertificateChoices)
return &cms->d.signedData->certificates;
case NID_pkcs7_enveloped:
if (cms->d.envelopedData->originatorInfo == NULL)
return NULL;
return &cms->d.envelopedData->originatorInfo->certificates;
default:
@ -420,6 +422,8 @@ static STACK_OF(CMS_RevocationInfoChoice)
return &cms->d.signedData->crls;
case NID_pkcs7_enveloped:
if (cms->d.envelopedData->originatorInfo == NULL)
return NULL;
return &cms->d.envelopedData->originatorInfo->crls;
default: