diff src/protocols/msn/slp.c @ 11235:5ea38c98ff30

[gaim-migrate @ 13380] Patch 1256826 from Federico Schwindt to ensure msg->body is always nul terminated (even though strictly it shouldn't need to be, it's safer like this). Plus a fix by me for one case where we were assuming it was already nul terminated. committer: Tailor Script <tailor@pidgin.im>
author Stu Tomlinson <stu@nosnilmot.com>
date Thu, 11 Aug 2005 19:25:48 +0000
parents 834a40ddab95
children fd6d96ef5c6d
line wrap: on
line diff
--- a/src/protocols/msn/slp.c	Thu Aug 11 15:53:09 2005 +0000
+++ b/src/protocols/msn/slp.c	Thu Aug 11 19:25:48 2005 +0000
@@ -787,15 +787,21 @@
 	MsnSlpLink *slplink;
 	MsnObject *obj;
 	char **tokens;
-	char *smile;
-	const char *who, *sha1c;
+	char *smile, *body_str;
+	const char *body, *who, *sha1c;
+	size_t body_len;
 
 	GaimConversation *conversation;
 	GaimConnection *gc;
 
 	session = cmdproc->servconn->session;
 
-	tokens = g_strsplit(msg->body, "\t", 2);
+	body = msn_message_get_bin_data(msg, &body_len);
+	body_str = g_strndup(body, body_len);
+
+	tokens = g_strsplit(body_str, "\t", 2);
+
+	g_free(body_str);
 
 	smile = tokens[0];
 	obj = msn_object_new_from_string(gaim_url_decode(tokens[1]));