# HG changeset patch # User Elliott Sales de Andrade # Date 1256279064 0 # Node ID 9aa7f4801549c6500cbf052a81e2761e76bd5df2 # Parent c3f79073c9bec3abbc5118319d7dea4efd44407b The connection display name can be NULL, so make sure we don't try to use that in a printf. Fixes #10529. diff -r c3f79073c9be -r 9aa7f4801549 libpurple/protocols/msn/contact.c --- a/libpurple/protocols/msn/contact.c Fri Oct 23 05:43:50 2009 +0000 +++ b/libpurple/protocols/msn/contact.c Fri Oct 23 06:24:24 2009 +0000 @@ -1232,8 +1232,13 @@ if (user->invite_message) { char *tmp; body = g_markup_escape_text(user->invite_message, -1); - tmp = g_markup_escape_text(purple_connection_get_display_name(session->account->gc), -1); + + /* Ignore the cast, we treat it as const anyway. */ + tmp = (char *)purple_connection_get_display_name(session->account->gc); + tmp = tmp ? g_markup_escape_text(tmp, -1) : g_strdup(""); + invite = g_strdup_printf(MSN_CONTACT_INVITE_MESSAGE_XML, body, tmp); + g_free(body); g_free(tmp);