pidgin.2.6.1: 37d8d30c: applied changes from 1b3177afd1f9ac62f43...

markdoliner at pidgin.im markdoliner at pidgin.im
Tue Aug 18 20:31:17 EDT 2009


-----------------------------------------------------------------
Revision: 37d8d30cab4f1bfe3c5a9d87fae63123382342f1
Ancestor: 757aacbfd44a84f30fbef7340fd5df8f7ff5c9d2
Author: markdoliner at pidgin.im
Date: 2009-08-19T00:28:10
Branch: im.pidgin.pidgin.2.6.1
URL: http://d.pidgin.im/viewmtn/revision/info/37d8d30cab4f1bfe3c5a9d87fae63123382342f1

Modified files:
        libpurple/protocols/yahoo/util.c
        libpurple/tests/test_yahoo_util.c

ChangeLog: 

applied changes from 1b3177afd1f9ac62f43488e54b8dd7055cfb1206
             through dd712fa84e46b2d78adf28e914d3e1a5c18a5154

Plucked this revision from im.pidgin.pidgin
Original commit message:
Fix a possible crash when receiving URLs in yahoo.  It doesn't crash for me
but it did for the guy reporting the bug.  Might be architecture
dependent or compile option dependent.  In any case this is bad and we
should release 2.6.1 tonight or tomorrow

-------------- next part --------------
============================================================
--- libpurple/protocols/yahoo/util.c	3b5fb040d83b95ad19527ffcb954ede41cbbe7ee
+++ libpurple/protocols/yahoo/util.c	31666b2add695540ed3a138e979cdb9a4e0089bf
@@ -553,13 +553,16 @@ char *yahoo_codes_to_html(const char *x)
 #endif /* !USE_CSS_FORMATTING */
 
 				} else if ((match = g_hash_table_lookup(esc_codes_ht, code))) {
-					gboolean is_closing_tag;
-					gchar *tag_name;
+					/* Some tags are in the hash table only because we
+					 * want to ignore them */
+					if (match[0] != '\0') {
+						gboolean is_closing_tag;
+						gchar *tag_name;
+						tag_name = yahoo_markup_get_tag_name(match, &is_closing_tag);
+						yahoo_codes_to_html_add_tag(&cur, match, is_closing_tag, tag_name, FALSE);
+						g_free(tag_name);
+					}
 
-					tag_name = yahoo_markup_get_tag_name(match, &is_closing_tag);
-					yahoo_codes_to_html_add_tag(&cur, match, is_closing_tag, tag_name, FALSE);
-					g_free(tag_name);
-
 				} else {
 					purple_debug_error("yahoo",
 						"Ignoring unknown ansi code 'ESC[%sm'.\n", code);
============================================================
--- libpurple/tests/test_yahoo_util.c	b342a75f6353a7384747087132e5957962cd4244
+++ libpurple/tests/test_yahoo_util.c	0dc8dea4e7749fe5623b6984929e4bf6ba9757d7
@@ -46,6 +46,10 @@ START_TEST(test_codes_to_html)
 	assert_string_equal_free("<b>bold <i>bolditalic <u>bolditalicunderline</u></i></b><i><u> italicunderline</u></i>",
 			yahoo_codes_to_html("\x1B[1mbold \x1B[2mbolditalic \x1B[4mbolditalicunderline\x1B[x1m italicunderline"));
 
+	/* link */
+	assert_string_equal_free("http://pidgin.im/",
+			yahoo_codes_to_html("\x1B[lmhttp://pidgin.im/\x1B[xlm"));
+
 #ifdef USE_CSS_FORMATTING
 	/* font color */
 	assert_string_equal_free("<span style='color: #0000FF'>blue</span>",


More information about the Commits mailing list