diff src/protocols/msn/msg.c @ 7846:61c07fefe1fc

[gaim-migrate @ 8500] Now we protect ourselves better when someone pastes binary content into a conversation. committer: Tailor Script <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Sat, 13 Dec 2003 06:19:56 +0000
parents 59f9508c9a31
children 06f57183e29f
line wrap: on
line diff
--- a/src/protocols/msn/msg.c	Sat Dec 13 06:13:51 2003 +0000
+++ b/src/protocols/msn/msg.c	Sat Dec 13 06:19:56 2003 +0000
@@ -309,7 +309,21 @@
 	}
 	else
 	{
-		msn_message_set_body(msg, tmp);
+		char *tmp2;
+		size_t body_len;
+
+		body_len = msg->size - (tmp - tmp_base);
+
+		tmp2 = g_malloc(body_len + 1);
+
+		if (body_len > 0)
+			memcpy(tmp2, tmp, body_len);
+
+		tmp2[body_len] = '\0';
+
+		msn_message_set_body(msg, tmp2);
+
+		g_free(tmp2);
 	}
 
 	g_free(command_header);