# HG changeset patch # User Elliott Sales de Andrade # Date 1327731557 0 # Node ID bc0d1855223f4379a3f0fe93a413f1f437678ca5 # Parent cd51eccbe602b0be03bbbd82c76bb403bac765be We know the length of decode_msg here. diff -r cd51eccbe602 -r bc0d1855223f libpurple/protocols/msn/oim.c --- a/libpurple/protocols/msn/oim.c Sat Jan 28 06:05:48 2012 +0000 +++ b/libpurple/protocols/msn/oim.c Sat Jan 28 06:19:17 2012 +0000 @@ -661,7 +661,7 @@ } 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 @@ 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,"