From 0641f1a9351fdb06d7e5d19a48ad7fe6175713e7 Mon Sep 17 00:00:00 2001
From: guoxiaoqi <guoxiaoqi2@huawei.com>
Date: Thu, 30 Apr 2020 09:40:20 +0800
Subject: [PATCH] fix core dump when sigd->signerInfos is NULL

Signed-off-by: guoxiaoqi <guoxiaoqi2@huawei.com>
---
 nss/lib/smime/cmssigdata.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/nss/lib/smime/cmssigdata.c b/nss/lib/smime/cmssigdata.c
index 7dd6ea4..32a8166 100644
--- a/nss/lib/smime/cmssigdata.c
+++ b/nss/lib/smime/cmssigdata.c
@@ -476,7 +476,7 @@ NSS_CMSSignedData_SignerInfoCount(NSSCMSSignedData *sigd)
 NSSCMSSignerInfo *
 NSS_CMSSignedData_GetSignerInfo(NSSCMSSignedData *sigd, int i)
 {
-    if (!sigd) {
+    if (!sigd || !sigd->signerInfos) {
         PORT_SetError(SEC_ERROR_INVALID_ARGS);
         return NULL;
     }
-- 
1.8.3.1

