Skip to content

Commit

Permalink
two fixes for certs with multiple instances
Browse files Browse the repository at this point in the history
  • Loading branch information
ian.mcgreer%sun.com committed Apr 18, 2002
1 parent caeb272 commit 2efbc5e
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions security/nss/lib/pki/pkibase.c
Expand Up @@ -141,6 +141,14 @@ nssPKIObject_AddInstance
nssCryptokiObject *,
object->numInstances + 1);
} else {
PRUint32 i;
for (i=0; i<object->numInstances; i++) {
if (nssCryptokiObject_Equal(object->instances[i], instance)) {
PZ_Unlock(object->lock);
nssCryptokiObject_Destroy(instance);
return PR_SUCCESS;
}
}
object->instances = nss_ZREALLOCARRAY(object->instances,
nssCryptokiObject *,
object->numInstances + 1);
Expand Down Expand Up @@ -654,6 +662,7 @@ nssPKIObjectCollection_AddObject
}
node->haveObject = PR_TRUE;
node->object = nssPKIObject_AddRef(object);
(*collection->getUIDFromObject)(object, node->uid);
PR_INIT_CLIST(&node->link);
PR_INSERT_BEFORE(&node->link, &collection->head);
collection->size++;
Expand Down

0 comments on commit 2efbc5e

Please sign in to comment.