--- a/libpurple/protocols/yahoo/yahoo_aliases.c Mon Jan 27 17:34:21 2014 +0530 +++ b/libpurple/protocols/yahoo/yahoo_aliases.c Wed Jan 29 00:28:08 2014 +0530 @@ -673,8 +673,14 @@ struct yahoo_pair *pair = l->data; switch (pair->key) { case 4: - who = pair->value; /* This is the person who sent us the details. - But not necessarily about himself. */ + if (g_utf8_validate(pair->value, -1, NULL)) { + /* This is the person who sent us the details. + But not necessarily about himself. */ + who = pair->value; + } else { + purple_debug_warning("yahoo", "yahoo_process_contact_details " + "got non-UTF-8 string for key %d\n", pair->key); + } break; case 5: break; @@ -686,8 +692,13 @@ and look into the xml instead to see who the information is about. */ break; case 280: - xml = pair->value; - parse_contact_details(yd, who, xml); + if (g_utf8_validate(pair->value, -1, NULL)) { + xml = pair->value; + parse_contact_details(yd, who, xml); + } else { + purple_debug_warning("yahoo", "yahoo_process_contact_details " + "got non-UTF-8 string for key %d\n", pair->key); + } break; } }