changeset 28791:9aa7f4801549

The connection display name can be NULL, so make sure we don't try to use that in a printf. Fixes #10529.
author Elliott Sales de Andrade <qulogic@pidgin.im>
date Fri, 23 Oct 2009 06:24:24 +0000
parents c3f79073c9be
children eec2df4b9a2d
files libpurple/protocols/msn/contact.c
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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);