changeset 9539:e8611c712d0a

[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 <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Fri, 16 Jul 2004 02:34:32 +0000
parents 1931a3977e23
children 44cef0cee90c
files src/protocols/oscar/oscar.c
diffstat 1 files changed, 11 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- 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)