From 63b2499b6733022c6d1906709df4d808c44b634e Mon Sep 17 00:00:00 2001 From: Phillip Hellewell Date: Sat, 11 Jun 2016 20:04:21 -0400 Subject: [PATCH] RT3053: Check for NULL before dereferencing Reviewed-by: Tim Hudson (cherry picked from commit 6b3602882e089aaca18828a72d9f4072e6a20252) --- crypto/cms/cms_lib.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/crypto/cms/cms_lib.c b/crypto/cms/cms_lib.c index d6cb60d02d..6d27c4969b 100644 --- a/crypto/cms/cms_lib.c +++ b/crypto/cms/cms_lib.c @@ -413,6 +413,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: @@ -488,6 +490,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: -- 2.25.1