/pidgin/main: 57771e51f8ca: I think we should verify UTF8 before...

Elliott Sales de Andrade qulogic at pidgin.im
Tue Jul 24 04:03:42 EDT 2012


Changeset: 57771e51f8ca450eb7962f6142bc5eb57c4b729b
Author:	 Elliott Sales de Andrade <qulogic at pidgin.im>
Date:	 2012-07-19 21:15 -0400
Branch:	 default
URL: http://hg.pidgin.im/pidgin/main/rev/57771e51f8ca

Description:

I think we should verify UTF8 before using a function wanting it.

diffstat:

 pidgin/gtkdebug.c |  8 +++-----
 1 files changed, 3 insertions(+), 5 deletions(-)

diffs (25 lines):

diff --git a/pidgin/gtkdebug.c b/pidgin/gtkdebug.c
--- a/pidgin/gtkdebug.c
+++ b/pidgin/gtkdebug.c
@@ -1165,7 +1165,8 @@
 	else
 		cat_s = g_strdup_printf("<b>%s:</b> ", category);
 
-	esc_s = g_markup_escape_text(arg_s, -1);
+	tmp = purple_utf8_try_convert(arg_s);
+	esc_s = g_markup_escape_text(tmp, -1);
 
 	s = g_strdup_printf("<font color=\"%s\">%s%s%s</font>",
 						debug_fg_colors[level], ts_s, cat_s, esc_s);
@@ -1173,10 +1174,7 @@
 	g_free(ts_s);
 	g_free(cat_s);
 	g_free(esc_s);
-
-	tmp = purple_utf8_try_convert(s);
-	g_free(s);
-	s = tmp;
+	g_free(tmp);
 
 	if (level == PURPLE_DEBUG_FATAL) {
 		tmp = g_strdup_printf("<b>%s</b>", s);



More information about the Commits mailing list