Fix a segfault when a PKCS#11 token is not found.

This commit is contained in:
Aaron Thompson 2020-04-03 05:42:26 +00:00 committed by Ondřej Surý
parent 46cae09023
commit 541d7bafe6

View file

@ -644,6 +644,9 @@ pk11_get_best_token(pk11_optype_t optype) {
token = best_eddsa_token;
break;
default:
break;
}
if (token == NULL) {
return (0);
}
return (token->slotid);