зеркало из https://github.com/mozilla/gecko-dev.git
353371: Klocwork 91117 - Null Pointer Dereference in CERT_CertChainFromCert. r=nelson
This commit is contained in:
Родитель
d484cb3d2b
Коммит
a7edef3088
|
@ -1044,6 +1044,10 @@ loser:
|
|||
NSSCryptoContext *cc = STAN_GetDefaultCryptoContext();
|
||||
|
||||
stanCert = STAN_GetNSSCertificate(cert);
|
||||
if (!stanCert) {
|
||||
/* error code is set */
|
||||
return NULL;
|
||||
}
|
||||
nssUsage.anyUsage = PR_FALSE;
|
||||
nssUsage.nss3usage = usage;
|
||||
nssUsage.nss3lookingForCA = PR_FALSE;
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#ifdef DEBUG
|
||||
static const char CVS_ID[] = "@(#) $RCSfile: certificate.c,v $ $Revision: 1.59 $ $Date: 2006/08/22 22:54:11 $";
|
||||
static const char CVS_ID[] = "@(#) $RCSfile: certificate.c,v $ $Revision: 1.60 $ $Date: 2006/10/09 18:45:02 $";
|
||||
#endif /* DEBUG */
|
||||
|
||||
#ifndef NSSPKI_H
|
||||
|
@ -493,10 +493,10 @@ nssCertificate_BuildChain (
|
|||
PRStatus st;
|
||||
PRStatus ret = PR_SUCCESS;
|
||||
|
||||
if (!td)
|
||||
td = NSSCertificate_GetTrustDomain(c);
|
||||
if (!td || !c || !cc)
|
||||
if (!c || !cc ||
|
||||
(!td && (td = NSSCertificate_GetTrustDomain(c)) == NULL)) {
|
||||
goto loser;
|
||||
}
|
||||
#ifdef NSS_3_4_CODE
|
||||
/* bump the usage up to CA level */
|
||||
issuerUsage.nss3lookingForCA = PR_TRUE;
|
||||
|
|
Загрузка…
Ссылка в новой задаче