summaryrefslogtreecommitdiff
path: root/lib/pk11wrap/pk11cert.c
diff options
context:
space:
mode:
authorDaiki Ueno <dueno@redhat.com>2017-05-19 13:06:29 +0200
committerDaiki Ueno <dueno@redhat.com>2017-05-19 13:06:29 +0200
commit575a754db0fcbb98d426dadd23ef057c8c727f6d (patch)
treeb36433b8dc1757942acffb03e3ec8a01a3b41bf1 /lib/pk11wrap/pk11cert.c
parentddd333f280ace4bbe1b720cd45798ff7c01aaa56 (diff)
downloadnss-hg-575a754db0fcbb98d426dadd23ef057c8c727f6d.tar.gz
Bug 1366187, pk11wrap: catch the case where NSSToken is not set, r=kaie
Diffstat (limited to 'lib/pk11wrap/pk11cert.c')
-rw-r--r--lib/pk11wrap/pk11cert.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/pk11wrap/pk11cert.c b/lib/pk11wrap/pk11cert.c
index 804db6da9..c1caf5e60 100644
--- a/lib/pk11wrap/pk11cert.c
+++ b/lib/pk11wrap/pk11cert.c
@@ -765,7 +765,12 @@ find_certs_from_nickname(const char *nickname, void *wincx)
*delimit = ':';
} else {
slot = PK11_GetInternalKeySlot();
- token = nssToken_AddRef(PK11Slot_GetNSSToken(slot));
+ token = PK11Slot_GetNSSToken(slot);
+ if (token) {
+ nssToken_AddRef(token);
+ } else {
+ PORT_SetError(SEC_ERROR_NO_TOKEN);
+ }
}
if (token) {
nssList *certList;