diff options
author | Daiki Ueno <dueno@redhat.com> | 2017-05-19 13:06:29 +0200 |
---|---|---|
committer | Daiki Ueno <dueno@redhat.com> | 2017-05-19 13:06:29 +0200 |
commit | 575a754db0fcbb98d426dadd23ef057c8c727f6d (patch) | |
tree | b36433b8dc1757942acffb03e3ec8a01a3b41bf1 /lib/pk11wrap/pk11cert.c | |
parent | ddd333f280ace4bbe1b720cd45798ff7c01aaa56 (diff) | |
download | nss-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.c | 7 |
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; |