From fb6e1098435c1b0e07eb4607b49dd9b9b50578ab Mon Sep 17 00:00:00 2001 From: Nalin Dahyabhai Date: Mon, 1 Nov 2010 19:07:12 -0400 Subject: [PATCH 099/150] - fix scanning of pkcs11 slots --- src/plugins/preauth/pkinit/pkinit_crypto_nss.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/src/plugins/preauth/pkinit/pkinit_crypto_nss.c b/src/plugins/preauth/pkinit/pkinit_crypto_nss.c index 4dd99b6..53f96ca 100644 --- a/src/plugins/preauth/pkinit/pkinit_crypto_nss.c +++ b/src/plugins/preauth/pkinit/pkinit_crypto_nss.c @@ -1974,7 +1974,9 @@ crypto_load_pkcs11(krb5_context context, /* Walk the list of slots in the module. */ status = SECFailure; - for (i = module->slotCount; (slot = module->slots[i]) != NULL; i++) { + for (i = 0; + (i < module->slotCount) && ((slot = module->slots[i]) != NULL); + i++) { /* Load private keys and their certs from this slot. */ if (cert_load_certs_with_keys_from_slot(context, id_cryptoctx, slot) == 0) { -- 1.7.6.4