# HG changeset patch # User Mark Doliner # Date 1089945272 0 # Node ID e8611c712d0a82170a59b73f6cc9dfeb012043db # Parent 1931a3977e236315e075a2fb734b42d9bd266f15 [gaim-migrate @ 10367] Fix a problem when oscar syncs the local list to the server list. If you've removed your last permit or deny buddy using a different client, then sign on with Gaim, it will crash. Fixes the following sf bugs (they're all the same) 982873 983874 984683 989580 989885 committer: Tailor Script diff -r 1931a3977e23 -r e8611c712d0a src/protocols/oscar/oscar.c --- a/src/protocols/oscar/oscar.c Fri Jul 16 01:35:49 2004 +0000 +++ b/src/protocols/oscar/oscar.c Fri Jul 16 02:34:32 2004 +0000 @@ -5775,7 +5775,7 @@ { /* If not in server list then prune from local list */ GaimBlistNode *gnode, *cnode, *bnode; GaimBuddyList *blist; - GSList *cur; + GSList *cur, *next; /* Buddies */ cur = NULL; @@ -5824,24 +5824,30 @@ /* Permit list */ if (gc->account->permit) { - for (cur=gc->account->permit; cur; cur=cur->next) + next = gc->account->permit; + while (next != NULL) { + cur = next; + next = next->next; if (!aim_ssi_itemlist_finditem(sess->ssi.local, NULL, cur->data, AIM_SSI_TYPE_PERMIT)) { gaim_debug_info("oscar", "ssi: removing permit %s from local list\n", (const char *)cur->data); gaim_privacy_permit_remove(account, cur->data, TRUE); - cur = gc->account->permit; } + } } /* Deny list */ if (gc->account->deny) { - for (cur=gc->account->deny; cur; cur=cur->next) + next = gc->account->deny; + while (next != NULL) { + cur = next; + next = next->next; if (!aim_ssi_itemlist_finditem(sess->ssi.local, NULL, cur->data, AIM_SSI_TYPE_DENY)) { gaim_debug_info("oscar", "ssi: removing deny %s from local list\n", (const char *)cur->data); gaim_privacy_deny_remove(account, cur->data, TRUE); - cur = gc->account->deny; } + } } /* Presence settings (idle time visibility) */ if ((tmp = aim_ssi_getpresence(sess->ssi.local)) != 0xFFFFFFFF)