From f3392f0b6a2e6824f89ccec9c255782b5d1848c9 Mon Sep 17 00:00:00 2001 From: "ian.mcgreer%sun.com" Date: Wed, 23 Jan 2002 17:39:29 +0000 Subject: [PATCH] fix core when token list is emptied (caused by switch to fips mode) --- security/nss/lib/base/list.c | 9 +++++++-- security/nss/lib/pk11wrap/pk11util.c | 1 - 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/security/nss/lib/base/list.c b/security/nss/lib/base/list.c index 29a075c8b686..782315ad4478 100644 --- a/security/nss/lib/base/list.c +++ b/security/nss/lib/base/list.c @@ -32,7 +32,7 @@ */ #ifdef DEBUG -static const char CVS_ID[] = "@(#) $RCSfile: list.c,v $ $Revision: 1.11 $ $Date: 2002/01/08 15:37:33 $ $Name: $"; +static const char CVS_ID[] = "@(#) $RCSfile: list.c,v $ $Revision: 1.12 $ $Date: 2002/01/23 17:39:27 $ $Name: $"; #endif /* DEBUG */ /* @@ -86,6 +86,9 @@ nsslist_get_matching_element(nssList *list, void *data) PRCList *link; nssListElement *node; node = list->head; + if (!node) { + return NULL; + } link = &node->link; while (node) { /* using a callback slows things down when it's just compare ... */ @@ -276,7 +279,9 @@ nssList_Remove(nssList *list, void *data) } PR_REMOVE_LINK(&node->link); nss_ZFreeIf(node); - --list->count; + if (--list->count == 0) { + list->head = NULL; + } } NSSLIST_UNLOCK_IF(list); return PR_SUCCESS; diff --git a/security/nss/lib/pk11wrap/pk11util.c b/security/nss/lib/pk11wrap/pk11util.c index ae4819ec7cae..dac513ba8489 100644 --- a/security/nss/lib/pk11wrap/pk11util.c +++ b/security/nss/lib/pk11wrap/pk11util.c @@ -323,7 +323,6 @@ SECMOD_DeleteInternalModule(char *name) { SECMOD_DestroyModule(oldModule); SECMOD_DeletePermDB(mlp->module); SECMOD_DestroyModuleListElement(mlp); - rv = STAN_AddModuleToDefaultTrustDomain(internalModule); } return rv; }