pidgin: 324353ef: Prevent a crash that can occur while cop...

datallah at pidgin.im datallah at pidgin.im
Mon Jan 26 22:35:22 EST 2009


-----------------------------------------------------------------
Revision: 324353ef9a60c0717f6a13e738a6aa905ef55422
Ancestor: 566d2e86bfd45c806aba1b32d6f85a9a409ff9ea
Author: datallah at pidgin.im
Date: 2009-01-27T03:32:11
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/324353ef9a60c0717f6a13e738a6aa905ef55422

Modified files:
        pidgin/gtkimhtml.c

ChangeLog: 

Prevent a crash that can occur while copying the contents of the Debug Window.  This ends up masking mismatched tags in the imhtml output, but that is 
better than a crash.
Thanks to Danilo Piazzalunga for figuring out what was happening.
Fixes #6089

-------------- next part --------------
============================================================
--- pidgin/gtkimhtml.c	0fd756c0f7debfce97d420b12aa86351e0233016
+++ pidgin/gtkimhtml.c	f83efb9fbd56e598965dd0519feb6121d8ee5f91
@@ -5378,12 +5378,14 @@ char *gtk_imhtml_get_markup_range(GtkIMH
 						text_tag_data_destroy(tmp);
 				}
 
-				if (tmp == NULL)
-					purple_debug_warning("gtkimhtml", "empty queue, more closing tags than open tags!\n");
-				else {
+				if (tmp != NULL) {
 					g_string_append(str, tmp->end);
 					text_tag_data_destroy(tmp);
 				}
+#if 0 /* This can't be allowed to happen because it causes the iters to be invalidated in the debug window imhtml during text copying */
+				else
+					purple_debug_warning("gtkimhtml", "empty queue, more closing tags than open tags!\n");
+#endif
 
 				while ((tmp = g_queue_pop_head(r))) {
 					g_string_append(str, tmp->start);


More information about the Commits mailing list