/pidgin/main: 8172584fd640: Fix for TALOS-CAN-0123
Andrew Victor <[email protected]> Mon, 20 Jun 2016 20:09:57 -0400
| Newsgroups | gmane.comp.gnome.gaim.cvs |
|---|---|
| Message-ID | <[email protected]> |
Changeset: 8172584fd6409f72f7799afad5c0cf55c43a5b08 Author: Andrew Victor <[email protected]> Date: 2016-06-02 16:04 -0500 Branch: release-2.x.y URL: https://hg.pidgin.im/pidgin/main/rev/8172584fd640 Description: Fix for TALOS-CAN-0123 diffstat: libpurple/protocols/mxit/markup.c | 19 ++++++++++++------- 1 files changed, 12 insertions(+), 7 deletions(-) diffs (36 lines): diff --git a/libpurple/protocols/mxit/markup.c b/libpurple/protocols/mxit/markup.c --- a/libpurple/protocols/mxit/markup.c +++ b/libpurple/protocols/mxit/markup.c @@ -1083,7 +1083,6 @@ char* mxit_convert_markup_tx( const char GList* entry; GList* tagstack = NULL; char* reply; - char color[8]; int len = strlen ( message ); int i; @@ -1145,12 +1144,18 @@ char* mxit_convert_markup_tx( const char } else if ( purple_str_has_prefix( &message[i], "<font color=" ) ) { /* font colour */ - tag = g_new0( struct tag, 1 ); - tag->type = MXIT_TAG_COLOR; - tagstack = g_list_append( tagstack, tag ); - memset( color, 0x00, sizeof( color ) ); - memcpy( color, &message[i + 13], 7 ); - g_string_append( mx, color ); + char color[8]; + + /* ensure we have the complete tag: <font color="#123456"> */ + if ( i + 20 < len ) { + tag = g_new0( struct tag, 1 ); + tag->type = MXIT_TAG_COLOR; + tagstack = g_list_append( tagstack, tag ); + + memset( color, 0x00, sizeof( color ) ); + memcpy( color, &message[i + 13], 7 ); + g_string_append( mx, color ); + } } else if ( purple_str_has_prefix( &message[i], "</font>" ) ) { /* end of font tag */ _______________________________________________ Commits mailing list [email protected] https://pidgin.im/cgi-bin/mailman/listinfo/commits