Skip to content

Commit

Permalink
We need to make sure we always return a trust object, even if that ob…
Browse files Browse the repository at this point in the history
…ject says

there is no trust.
  • Loading branch information
relyea%netscape.com committed Apr 18, 2002
1 parent 417b04b commit be22bde
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions security/nss/lib/pki/pki3hack.c
Expand Up @@ -530,14 +530,15 @@ nssTrust_GetCERTCertTrustForCert(NSSCertificate *c, CERTCertificate *cc)
return NULL;
}
nssTrust_Destroy(t);
} else {
rvTrust = PORT_ArenaAlloc(cc->arena, sizeof(CERTCertTrust));
if (!rvTrust) {
return NULL;
}
memset(rvTrust, 0, sizeof(*rvTrust));
}
if (is_user_cert(c, cc)) {
if (!rvTrust) {
rvTrust = PORT_ArenaAlloc(cc->arena, sizeof(CERTCertTrust));
if (!rvTrust) {
return NULL;
}
memset(rvTrust, 0, sizeof(*rvTrust));
}
rvTrust->sslFlags |= CERTDB_USER;
rvTrust->emailFlags |= CERTDB_USER;
Expand Down

0 comments on commit be22bde

Please sign in to comment.