pidgin: 2e4b491e: jabber: Stricter checks on the send_raw ...

darkrain42 at pidgin.im darkrain42 at pidgin.im
Tue Jun 15 18:46:01 EDT 2010


-----------------------------------------------------------------
Revision: 2e4b491ee89464d56b79db045bcef7f63fda6b97
Ancestor: 8d0bb2830b866b018ff771a36b7bddfa4aef8f7a
Author: darkrain42 at pidgin.im
Date: 2010-06-15T22:41:37
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/2e4b491ee89464d56b79db045bcef7f63fda6b97

Modified files:
        libpurple/protocols/jabber/jabber.c

ChangeLog: 

jabber: Stricter checks on the send_raw prpl function.

This (should) avoids a crash in the gtalkinvisible plugin as seen in a crash
log from #pidgin.  The plugin is trying to send a stanza as the (eventual)
result of the signing-on signal, which is before prpl_info->login() is called.

Call stack:
jabber_send_raw  protocols/jabber/jabber.c:443
jabber_prpl_send_raw  protocols/jabber/jabber.c:548
6EA0122D plugins\gtalkinvisible.dll  plugin_invisible_cb  gtalkinvisible.c:147
67D0410B  purple_signal_emit_vargs  signals.c:465
67D04217  purple_signal_emit  signals.c:436
67CFB75F  purple_prpl_change_account_status  prpl.c:389
67D09B3F  status_has_changed  status.c:669
67CC4409  purple_account_set_status_list  account.c:1783
67CC4717  purple_account_set_status  account.c:1752
67D00F18  purple_savedstatus_activate_for_account  savedstatuses.c:1174
67D01899  purple_savedstatus_set_idleaway  savedstatuses.c:887
67CE5D13  check_idleness  idle.c:193
67D0410B  purple_signal_emit_vargs  signals.c:465
67D04217  purple_signal_emit  signals.c:436
67CD9F34  _purple_connection_new  connection.c:157
67CC56C1  purple_account_connect  account.c:1216

-------------- next part --------------
============================================================
--- libpurple/protocols/jabber/jabber.c	ae1a7be34b9d204679e0a2490331e12906f72cd6
+++ libpurple/protocols/jabber/jabber.c	8f43fd5f70bf5bcfc48893ee9f27302fa9da97a2
@@ -543,6 +543,13 @@ int jabber_prpl_send_raw(PurpleConnectio
 int jabber_prpl_send_raw(PurpleConnection *gc, const char *buf, int len)
 {
 	JabberStream *js = purple_connection_get_protocol_data(gc);
+
+	g_return_val_if_fail(js != NULL, -1);
+	/* TODO: It's probably worthwhile to restrict this to when the account
+	 * state is CONNECTED, but I can /almost/ envision reasons for wanting
+	 * to do things during the connection process.
+	 */
+
 	jabber_send_raw(js, buf, len);
 	return len;
 }


More information about the Commits mailing list