pidgin/ljfisher-ssl-client-auth

Fix another possible remote crash bug in SILC.
release-2.x.y
2011-12-06, Mark Doliner
fa8d4132d071
Parents 9d90f89322ea
Children 883a1b407408
Fix another possible remote crash bug in SILC.

This is the same change that Ethan made in 69372ee4f474efcca38b010bc2cdd61a917955f4,
but to a different function. Refs #14636
--- a/libpurple/protocols/silc/ops.c Tue Dec 06 06:47:37 2011 +0000
+++ b/libpurple/protocols/silc/ops.c Tue Dec 06 06:50:18 2011 +0000
@@ -332,10 +332,17 @@
}
if (flags & SILC_MESSAGE_FLAG_UTF8) {
- tmp = g_markup_escape_text((const char *)message, -1);
+ const char *msg = (const char *)message;
+ char *salvaged = NULL;
+ if (!g_utf8_validate((const char *)message, -1, NULL)) {
+ salvaged = purple_utf8_salvage((const char *)message);
+ msg = salvaged;
+ }
+ tmp = g_markup_escape_text(msg, -1);
/* Send to Purple */
serv_got_chat_in(gc, purple_conv_chat_get_id(PURPLE_CONV_CHAT(convo)),
sender->nickname, 0, tmp, time(NULL));
+ g_free(salvaged);
g_free(tmp);
}
}