In SEC_PKCS12DecoderGetCerts, don't dereference p12dcx until AFTER it has
authornelson%bolyard.com
Thu, 18 May 2006 19:38:59 +0000
changeset 7093 f5eb32a41ed309a56635eae2698b295a566c6b5a
parent 7091 761622916572b2556da272ad8511ee67ae9e4663
child 7095 80eb96e093ea0ebc2007733d5335f19974d22c70
push idunknown
push userunknown
push dateunknown
bugs336971
In SEC_PKCS12DecoderGetCerts, don't dereference p12dcx until AFTER it has been checked for NULL. Coverity bug 336971. r=alexei.volkov
security/nss/lib/pkcs12/p12d.c
--- a/security/nss/lib/pkcs12/p12d.c
+++ b/security/nss/lib/pkcs12/p12d.c
@@ -2535,17 +2535,17 @@ sec_pkcs12_find_certs_for_key(sec_PKCS12
 
     return certList;
 }
 
 CERTCertList *
 SEC_PKCS12DecoderGetCerts(SEC_PKCS12DecoderContext *p12dcx)
 {
     CERTCertList *certList = NULL;
-    sec_PKCS12SafeBag **safeBags = p12dcx->safeBags;
+    sec_PKCS12SafeBag **safeBags;
     int i;
 
     if (!p12dcx || !p12dcx->safeBags || !p12dcx->safeBags[0]) {
 	PORT_SetError(SEC_ERROR_INVALID_ARGS);
 	return NULL;
     }
 
     safeBags = p12dcx->safeBags;