We know the length of decode_msg here.
authorElliott Sales de Andrade <qulogic@pidgin.im>
Sat, 28 Jan 2012 06:19:17 +0000
changeset5c02bc93f2c4 pushlog
parent f5fd49c83637
child 85ec889f1675
We know the length of decode_msg here.
libpurple/protocols/msn/oim.c
     1.1 --- a/libpurple/protocols/msn/oim.c
     1.2 +++ b/libpurple/protocols/msn/oim.c
     1.3 @@ -661,7 +661,7 @@
     1.4  	}
     1.5  
     1.6  	if (charset && !((strncasecmp(charset, "UTF-8", 5) == 0) || (strncasecmp(charset, "UTF8", 4) == 0))) {
     1.7 -		clean_msg = g_convert(decode_msg, strlen(decode_msg), "UTF-8", charset, NULL, NULL, NULL);
     1.8 +		clean_msg = g_convert(decode_msg, body_len, "UTF-8", charset, NULL, NULL, NULL);
     1.9  
    1.10  		if (!clean_msg) {
    1.11  			char *clean = purple_utf8_salvage(decode_msg);
    1.12 @@ -677,7 +677,7 @@
    1.13  		g_free(decode_msg);
    1.14  
    1.15  	} else {
    1.16 -		if (!g_utf8_validate(decode_msg, -1, NULL)) {
    1.17 +		if (!g_utf8_validate(decode_msg, body_len, NULL)) {
    1.18  			char *clean = purple_utf8_salvage(decode_msg);
    1.19  
    1.20  			purple_debug_error("msn", "Received an OIM message that is not UTF-8,"