# HG changeset patch # User Evan Schoenberg # Date 1173740283 0 # Node ID a1564afbad84340269aed30d164a4d4872de8d94 # Parent f75aa2bf49738e28ffecab7cbe04f0784426c8fa Patch from plivesey, submitted in Adium Trac #5753 (http://trac.adiumx.com/ticket/5753), which fixes a memory stomper which occurred if the msn prpl were passed HTML with multiple style tags of the same type. This doesn't happen in pidgin, because the gtkhtml widget knows that msn can only have one all-or-none instance of each style, but libpurple should be able to handle being passed any sort of HTML. This therefore fixes an Adium crash. diff -r f75aa2bf4973 -r a1564afbad84 libpurple/protocols/msn/msn-utils.c --- a/libpurple/protocols/msn/msn-utils.c Sat Mar 10 17:24:53 2007 +0000 +++ b/libpurple/protocols/msn/msn-utils.c Mon Mar 12 22:58:03 2007 +0000 @@ -174,6 +174,11 @@ char fonteffect[4]; char fontcolor[7]; + gboolean haveBold = FALSE; + gboolean haveItalic = FALSE; + gboolean haveUnderline = FALSE; + gboolean haveStrikethrough = FALSE; + g_return_if_fail(html != NULL); g_return_if_fail(attributes != NULL); g_return_if_fail(message != NULL); @@ -197,22 +202,38 @@ } else if (!g_ascii_strncasecmp(c + 1, "i>", 2)) { - strcat(fonteffect, "I"); + if ( haveItalic == FALSE ) + { + strcat(fonteffect, "I"); + haveItalic = TRUE; + } c += 3; } else if (!g_ascii_strncasecmp(c + 1, "b>", 2)) { - strcat(fonteffect, "B"); + if ( haveBold == FALSE ) + { + strcat(fonteffect, "B"); + haveBold = TRUE; + } c += 3; } else if (!g_ascii_strncasecmp(c + 1, "u>", 2)) { - strcat(fonteffect, "U"); + if ( haveUnderline == FALSE ) + { + strcat(fonteffect, "U"); + haveUnderline = TRUE; + } c += 3; } else if (!g_ascii_strncasecmp(c + 1, "s>", 2)) { - strcat(fonteffect, "S"); + if ( haveStrikethrough == FALSE ) + { + strcat(fonteffect, "S"); + haveStrikethrough = TRUE; + } c += 3; } else if (!g_ascii_strncasecmp(c + 1, "a href=\"", 8))