--- a/libpurple/protocols/oscar/family_bart.c Thu May 03 08:36:47 2012 +0000 +++ b/libpurple/protocols/oscar/family_bart.c Thu May 03 09:28:11 2012 +0000 @@ -143,6 +143,12 @@ guint8 iconcsumtype, iconcsumlen, *iconcsum, *icon; bn = byte_stream_getstr(bs, byte_stream_get8(bs)); + if (!g_utf8_validate(bn, -1, NULL)) { + purple_debug_warning("oscar", "Received SNAC %04hx/%04hx with " + "invalid UTF-8 buddy name.\n", snac->family, snac->subtype); + g_free(bn); + return 1; + } flags = byte_stream_get16(bs); iconcsumtype = byte_stream_get8(bs); iconcsumlen = byte_stream_get8(bs);