libpurple/protocols/yahoo/yahoo_aliases.c

changeset 35265
77664079d0f0
parent 34940
c0aef3b64c56
parent 35259
b0345c25f886
child 35499
c4c5e0a670b1
child 37016
48f85579cc4c
--- a/libpurple/protocols/yahoo/yahoo_aliases.c	Mon Jan 20 07:39:26 2014 +0530
+++ b/libpurple/protocols/yahoo/yahoo_aliases.c	Mon Jan 20 00:02:17 2014 -0800
@@ -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;
 		}
 	}

mercurial