comparison libpurple/protocols/msn/contact.c @ 28419: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 23f6f80f45ed
comparison
equal deleted inserted replaced
28418:c3f79073c9be 28419:9aa7f4801549
1230 } 1230 }
1231 1231
1232 if (user->invite_message) { 1232 if (user->invite_message) {
1233 char *tmp; 1233 char *tmp;
1234 body = g_markup_escape_text(user->invite_message, -1); 1234 body = g_markup_escape_text(user->invite_message, -1);
1235 tmp = g_markup_escape_text(purple_connection_get_display_name(session->account->gc), -1); 1235
1236 /* Ignore the cast, we treat it as const anyway. */
1237 tmp = (char *)purple_connection_get_display_name(session->account->gc);
1238 tmp = tmp ? g_markup_escape_text(tmp, -1) : g_strdup("");
1239
1236 invite = g_strdup_printf(MSN_CONTACT_INVITE_MESSAGE_XML, body, tmp); 1240 invite = g_strdup_printf(MSN_CONTACT_INVITE_MESSAGE_XML, body, tmp);
1241
1237 g_free(body); 1242 g_free(body);
1238 g_free(tmp); 1243 g_free(tmp);
1239 1244
1240 /* We can free this now */ 1245 /* We can free this now */
1241 g_free(user->invite_message); 1246 g_free(user->invite_message);