[empathy] tp_chat_group_members_changed_cb: early return if removed or added have not the expected length (#62



commit 6c6409c01aeeec60ee88eecbf9efa4aa8b0629f0
Author: Simon McVittie <simon mcvittie collabora co uk>
Date:   Tue Sep 14 10:36:55 2010 +0200

    tp_chat_group_members_changed_cb: early return if removed or added have not the expected length (#629549)

 libempathy/empathy-tp-chat.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/libempathy/empathy-tp-chat.c b/libempathy/empathy-tp-chat.c
index 6f4874f..375683b 100644
--- a/libempathy/empathy-tp-chat.c
+++ b/libempathy/empathy-tp-chat.c
@@ -1119,8 +1119,11 @@ tp_chat_group_members_changed_cb (TpChannel     *self,
 	/* Contact renamed */
 	if (reason == TP_CHANNEL_GROUP_CHANGE_REASON_RENAMED) {
 		/* there can only be a single 'added' and a single 'removed' handle */
-		g_warn_if_fail (removed->len == 1);
-		g_warn_if_fail (added->len == 1);
+		if (removed->len != 1 || added->len != 1) {
+			g_warning ("RENAMED with %u added, %u removed (expected 1, 1)",
+				added->len, removed->len);
+			return;
+		}
 
 		old_handle = g_array_index (removed, guint, 0);
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]