pkcs11_lib.c:289: warning: 'i' is used uninitialized in this function ================================================================================ --- src/common/pkcs11_lib.c +++ src/common/pkcs11_lib.c @@ -283,14 +283,15 @@ return 0; } } - } + } else { /* we're configured for a specific module and token, see if it's present */ - slot_num--; - if (slot_num >= 0 && slot_num < module->slotCount && module->slots && - module->slots[i] && PK11_IsPresent(module->slots[i])) { - h->slot = PK11_ReferenceSlot(module->slots[i]); - *slotID = PK11_GetSlotID(h->slot); - return 0; + slot_num--; + if (slot_num >= 0 && slot_num < module->slotCount && module->slots && + module->slots[slot_num] && PK11_IsPresent(module->slots[slot_num])) { + h->slot = PK11_ReferenceSlot(module->slots[slot_num]); + *slotID = PK11_GetSlotID(h->slot); + return 0; + } } return -1; }