# HG changeset patch # User Daniel Atallah # Date 1218071317 0 # Node ID 27eacd38c721c78c7bf126dea9a26f4a1e202e85 # Parent ccc0dd1db9aee4070739d4756735f8d405cb6535 Add NULL checking to purple_markup_linkify(). Display meanwhile announcements that don't have message text associated (I'm not sure if this is right, the current code doesn't allow for that scenario). Fixes #6518 diff -r ccc0dd1db9ae -r 27eacd38c721 libpurple/protocols/sametime/sametime.c --- a/libpurple/protocols/sametime/sametime.c Wed Aug 06 15:50:04 2008 +0000 +++ b/libpurple/protocols/sametime/sametime.c Thu Aug 07 01:08:37 2008 +0000 @@ -1816,7 +1816,7 @@ who = g_strdup_printf(_("Announcement from %s"), who); msg = purple_markup_linkify(text); - purple_conversation_write(conv, who, msg, PURPLE_MESSAGE_RECV, time(NULL)); + purple_conversation_write(conv, who, msg ? msg : "", PURPLE_MESSAGE_RECV, time(NULL)); g_free(who); g_free(msg); } diff -r ccc0dd1db9ae -r 27eacd38c721 libpurple/util.c --- a/libpurple/util.c Wed Aug 06 15:50:04 2008 +0000 +++ b/libpurple/util.c Thu Aug 07 01:08:37 2008 +0000 @@ -2031,8 +2031,12 @@ gunichar g; gboolean inside_html = FALSE; int inside_paren = 0; - GString *ret = g_string_new(""); - /* Assumes you have a buffer able to carry at least BUF_LEN * 2 bytes */ + GString *ret; + + if (text == NULL) + return NULL; + + ret = g_string_new(""); c = text; while (*c) {