changeset 27680:4e1eef14b095

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.
author Paul Aurich <paul@darkrain42.org>
date Sat, 18 Jul 2009 04:06:48 +0000
parents 0ec880685f5f
children 37b668b8d6c1
files libpurple/protocols/oscar/peer.c
diffstat 1 files changed, 10 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/oscar/peer.c	Sat Jul 18 03:36:33 2009 +0000
+++ b/libpurple/protocols/oscar/peer.c	Sat Jul 18 04:06:48 2009 +0000
@@ -710,9 +710,18 @@
 	}
 	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);