pidgin: 6543699e: Add some debugging for a file transfer c...

darkrain42 at pidgin.im darkrain42 at pidgin.im
Sat Jul 18 00:10:21 EDT 2009


-----------------------------------------------------------------
Revision: 6543699e5f6e245ea5a903f2ee37d94f130fd66a
Ancestor: ec29a54aa61b4c11cb1dcc61b5a32aa07e10d9ce
Author: darkrain42 at pidgin.im
Date: 2009-07-18T04:06:48
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/6543699e5f6e245ea5a903f2ee37d94f130fd66a

Modified files:
        libpurple/protocols/oscar/peer.c

ChangeLog: 

Add some debugging for a file transfer crash. Refs #4829.

The crash is happening because something in inner_tlvlist in
aim_im_sendch2_sendfile_requestdirect is NULL, which then causes
aim_tlvlist_write to call byte_stream_putraw on a NULL pointer
(length is greater than 0, so aim_tlvlist_write assumes there is
something there). I don't see *why*, but I think this will "fix"
it.

-------------- next part --------------
============================================================
--- libpurple/protocols/oscar/peer.c	fcca028aba9daf06552732aaf4fc1760fecd3f78
+++ libpurple/protocols/oscar/peer.c	200727b1bbc271e215f5044d53b59d77344db2db
@@ -710,9 +710,18 @@ peer_connection_establish_listener_cb(in
 	}
 	else if (conn->type == OSCAR_CAPABILITY_SENDFILE)
 	{
+		const guchar *ip_atoi = purple_network_ip_atoi(listener_ip);
+		if (ip_atoi == NULL) {
+			purple_debug_error("oscar", "Cannot send file. IP %s failed atoi.\n"
+					"Other possibly useful information: fd = %d, port = %d\n",
+			                   listener_ip ? listener_ip : "(null!)", conn->listenerfd,
+							   listener_port);
+			purple_xfer_cancel_local(conn->xfer);
+			return;
+		}
 		aim_im_sendch2_sendfile_requestdirect(od,
 				conn->cookie, conn->bn,
-				purple_network_ip_atoi(listener_ip),
+				ip_atoi,
 				listener_port, ++conn->lastrequestnumber,
 				(const gchar *)conn->xferdata.name,
 				conn->xferdata.size, conn->xferdata.totfiles);


More information about the Commits mailing list