From af78e18151766754b07778060e1f7e302a150431 Mon Sep 17 00:00:00 2001 From: Alessio Di Mauro Date: Wed, 5 Oct 2016 16:33:24 +0200 Subject: [PATCH] Always set number of slots Relates to #98. --- ykcs11/ykcs11.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ykcs11/ykcs11.c b/ykcs11/ykcs11.c index e373b47..d1aa456 100644 --- a/ykcs11/ykcs11.c +++ b/ykcs11/ykcs11.c @@ -198,14 +198,17 @@ CK_DEFINE_FUNCTION(CK_RV, C_GetSlotList)( return CKR_CRYPTOKI_NOT_INITIALIZED; } - if (pSlotList == NULL_PTR) { - // Just return the number of slots + if (pulCount) { *pulCount = n_slots; if (tokenPresent) *pulCount = n_slots_with_token; else *pulCount = n_slots; + } + + if (pSlotList == NULL_PTR) { + // Just return the number of slots DOUT; return CKR_OK;