summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjavi%netscape.com <devnull@localhost>2002-02-15 01:50:28 +0000
committerjavi%netscape.com <devnull@localhost>2002-02-15 01:50:28 +0000
commit3a020a098871f9b4bf78c3cac57ea7a1e8858721 (patch)
tree4ecc4f92a9f8874ac7180cd0298f3ec2ad4f5ef4
parent1afdd9d0ceedd2baea95a9e439bbfc7835c8c791 (diff)
downloadnss-hg-3a020a098871f9b4bf78c3cac57ea7a1e8858721.tar.gz
Fix crash when looking up cert by nickname when the token on which
the cert is located is not plugged in. Bug 125611
-rw-r--r--security/nss/lib/pk11wrap/pk11cert.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/security/nss/lib/pk11wrap/pk11cert.c b/security/nss/lib/pk11wrap/pk11cert.c
index c00a92f2f..9bae7c27c 100644
--- a/security/nss/lib/pk11wrap/pk11cert.c
+++ b/security/nss/lib/pk11wrap/pk11cert.c
@@ -1383,7 +1383,9 @@ PK11_FindCertFromNickname(char *nickname, void *wincx) {
*delimit = '\0';
/* find token by name */
token = NSSTrustDomain_FindTokenByName(defaultTD, (NSSUTF8 *)tokenName);
- slot = PK11_ReferenceSlot(token->pk11slot);
+ if (token) {
+ slot = PK11_ReferenceSlot(token->pk11slot);
+ }
*delimit = ':';
} else {
slot = PK11_GetInternalKeySlot();