diff src/list.c @ 2586:0f5390176949

[gaim-migrate @ 2599] try to do things more safely. dialogs.c is really what should be changed though. committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Tue, 23 Oct 2001 08:22:48 +0000
parents 20418e5702eb
children 2dd86a1af92b
line wrap: on
line diff
--- a/src/list.c	Tue Oct 23 08:15:00 2001 +0000
+++ b/src/list.c	Tue Oct 23 08:22:48 2001 +0000
@@ -106,6 +106,9 @@
 	struct group *g;
 	char *good;
 
+	if (!g_slist_find(connections, gc))
+		return NULL;
+
 	if ((b = find_buddy(gc, buddy)) != NULL)
 		return b;
 
@@ -145,6 +148,8 @@
 	struct group *g = find_group(gc, group);
 	if (g)
 		return g;
+	if (!g_slist_find(connections, gc))
+		return NULL;
 	g = (struct group *)g_new0(struct group, 1);
 	if (!g)
 		return NULL;
@@ -170,6 +175,8 @@
 
 	strcpy(grpname, normalize (group));
 	if (gc) {
+		if (!g_slist_find(connections, gc))
+			return NULL;
 		grp = gc->groups;
 		while (grp) {
 			g = (struct group *)grp->data;
@@ -278,6 +285,8 @@
 	char *(*norm)(const char *);
 
 	if (gc) {
+		if (!g_slist_find(connections, gc))
+			return NULL;
 		if (gc->prpl->normalize)
 			norm = gc->prpl->normalize;
 		else