# HG changeset patch # User Mark Doliner # Date 1250639534 0 # Node ID 617e7a90b69cc19aad931e5b950e7f0cae40d99a # Parent c69c79921f933919d6263402d22992191aa0dc48 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 diff -r c69c79921f93 -r 617e7a90b69c libpurple/protocols/yahoo/util.c --- a/libpurple/protocols/yahoo/util.c Tue Aug 18 23:03:47 2009 +0000 +++ b/libpurple/protocols/yahoo/util.c Tue Aug 18 23:52:14 2009 +0000 @@ -553,12 +553,15 @@ #endif /* !USE_CSS_FORMATTING */ } else if ((match = g_hash_table_lookup(esc_codes_ht, code))) { - 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); + /* 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); + } } else { purple_debug_error("yahoo", diff -r c69c79921f93 -r 617e7a90b69c libpurple/tests/test_yahoo_util.c --- a/libpurple/tests/test_yahoo_util.c Tue Aug 18 23:03:47 2009 +0000 +++ b/libpurple/tests/test_yahoo_util.c Tue Aug 18 23:52:14 2009 +0000 @@ -50,6 +50,10 @@ assert_string_equal_free("bold bolditalic bolditalicunderline italicunderline", 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("blue",