# HG changeset patch # User Elliott Sales de Andrade # Date 1256370782 0 # Node ID 44cbfcaf9e3ac710bfa6b87a7113e4b97c03caf9 # Parent a335d1bab20e2fcd3f1dda14a8afb9475d876b49 Fix a crash when sending OIMs on MSN. The callback function used after updating the token was incorrectly defined with void return and could be called again after the timeout (as would normally happen for timeouts that return TRUE). Thanks to Sadrul for getting a good backtrace and finding the real cause. Fixes #8155. diff -r a335d1bab20e -r 44cbfcaf9e3a ChangeLog --- a/ChangeLog Sat Oct 24 00:59:12 2009 +0000 +++ b/ChangeLog Sat Oct 24 07:53:02 2009 +0000 @@ -16,6 +16,7 @@ * Fix a random crash that might occur when idle. * Fix more FQY 240 connection errors. * Fix a crash that could occur when adding a buddy. + * Fix an occasional crash when sending message to an offline user. XMPP: * Users connecting to Google Talk now have an "Initiate Chat" context menu diff -r a335d1bab20e -r 44cbfcaf9e3a libpurple/protocols/msn/oim.c --- a/libpurple/protocols/msn/oim.c Sat Oct 24 00:59:12 2009 +0000 +++ b/libpurple/protocols/msn/oim.c Sat Oct 24 07:53:02 2009 +0000 @@ -153,7 +153,7 @@ gpointer cb_data; } MsnOimRequestData; -static void msn_oim_request_helper(MsnOimRequestData *data); +static gboolean msn_oim_request_helper(MsnOimRequestData *data); static void msn_oim_request_cb(MsnSoapMessage *request, MsnSoapMessage *response, @@ -202,7 +202,7 @@ g_free(data); } -static void +static gboolean msn_oim_request_helper(MsnOimRequestData *data) { MsnSession *session = data->oim->session; @@ -224,13 +224,13 @@ const char *msn_p; token = msn_nexus_get_token(session->nexus, MSN_AUTH_MESSENGER_WEB); - g_return_if_fail(token != NULL); + g_return_val_if_fail(token != NULL, FALSE); msn_t = g_hash_table_lookup(token, "t"); msn_p = g_hash_table_lookup(token, "p"); - g_return_if_fail(msn_t != NULL); - g_return_if_fail(msn_p != NULL); + g_return_val_if_fail(msn_t != NULL, FALSE); + g_return_val_if_fail(msn_p != NULL, FALSE); passport = xmlnode_get_child(data->body, "Header/PassportCookie"); xml_t = xmlnode_get_child(passport, "t"); @@ -248,6 +248,8 @@ msn_soap_message_new(data->action, xmlnode_copy(data->body)), data->host, data->url, FALSE, msn_oim_request_cb, data); + + return FALSE; }