Fix for 265707 . SECMOD_FindSlot always returns NULL (regression). r=wtc MOZILLA_1_7_BRANCH MOZILLA_1_7_5_RELEASE
authorwchang0222%aol.com
Tue, 02 Nov 2004 18:37:59 +0000
branchMOZILLA_1_7_BRANCH
changeset 5414 4e7386341e699cdd5adc04808ad40eb970deff68
parent 5385 edb016011f989603faf84a6f6de26d8a54db4014
child 5463 4e91202705d747ac0b3e47492972994b4ca40a26
push idunknown
push userunknown
push dateunknown
reviewerswtc
bugs265707, 265708
Fix for 265707 . SECMOD_FindSlot always returns NULL (regression). r=wtc a=mkaply. Fix for 265708. - count should be CK_ULONG Tag: MOZILLA_1_7_BRANCH
security/nss/lib/pk11wrap/pk11util.c
--- a/security/nss/lib/pk11wrap/pk11util.c
+++ b/security/nss/lib/pk11wrap/pk11util.c
@@ -516,17 +516,16 @@ SECMOD_FindSlot(SECMODModule *module,con
 	    break;
 	}
     }
     SECMOD_ReleaseReadLock(moduleLock);
 
     if (retSlot == NULL) {
 	PORT_SetError(SEC_ERROR_NO_SLOT_SELECTED);
     }
-    return NULL;
     return retSlot;
 }
 
 SECStatus
 PK11_GetModInfo(SECMODModule *mod,CK_INFO *info)
 {
     CK_RV crv;
 
@@ -849,17 +848,18 @@ SECMOD_CanDeleteInternalModule(void)
  * C_GetSlotList(flag, &data, &count) so that the array doesn't accidently
  * grow on the caller. It is permissible for the slots to increase between
  * successive calls with NULL to get the size.
  */
 SECStatus
 SECMOD_UpdateSlotList(SECMODModule *mod)
 {
     CK_RV crv;
-    int count,i, oldCount;
+    CK_ULONG count;
+    int i, oldCount;
     PRBool freeRef = PR_FALSE;
     void *mark;
     CK_ULONG *slotIDs = NULL;
     PK11SlotInfo **newSlots = NULL;
     PK11SlotInfo **oldSlots = NULL;
 
     /* C_GetSlotList is not a session function, make sure 
      * calls are serialized */