pidgin: fdb56683: We know the length of decode_msg here.

qulogic at pidgin.im qulogic at pidgin.im
Fri Feb 3 01:56:46 EST 2012


----------------------------------------------------------------------
Revision: fdb56683f2b5f88f7b388aaef6c53c810d19e374
Parent:   b1b8c222ab921963f43e83502b6c6e2e4489a8c4
Author:   qulogic at pidgin.im
Date:     01/28/12 01:19:17
Branch:   im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/fdb56683f2b5f88f7b388aaef6c53c810d19e374

Changelog: 

We know the length of decode_msg here.

Changes against parent b1b8c222ab921963f43e83502b6c6e2e4489a8c4

  patched  libpurple/protocols/msn/oim.c

-------------- next part --------------
============================================================
--- libpurple/protocols/msn/oim.c	23a616c617ec7f7ac83515d1d179f49c659e8703
+++ libpurple/protocols/msn/oim.c	9d5bb783f66cb29d9b694d261db628f07ac1d713
@@ -661,7 +661,7 @@ msn_oim_report_to_user(MsnOimRecvData *r
 	}
 
 	if (charset && !((strncasecmp(charset, "UTF-8", 5) == 0) || (strncasecmp(charset, "UTF8", 4) == 0))) {
-		clean_msg = g_convert(decode_msg, strlen(decode_msg), "UTF-8", charset, NULL, NULL, NULL);
+		clean_msg = g_convert(decode_msg, body_len, "UTF-8", charset, NULL, NULL, NULL);
 
 		if (!clean_msg) {
 			char *clean = purple_utf8_salvage(decode_msg);
@@ -677,7 +677,7 @@ msn_oim_report_to_user(MsnOimRecvData *r
 		g_free(decode_msg);
 
 	} else {
-		if (!g_utf8_validate(decode_msg, -1, NULL)) {
+		if (!g_utf8_validate(decode_msg, body_len, NULL)) {
 			char *clean = purple_utf8_salvage(decode_msg);
 
 			purple_debug_error("msn", "Received an OIM message that is not UTF-8,"


More information about the Commits mailing list