--- a/libpurple/protocols/yahoo/libymsg.c Sat Jan 18 16:30:55 2014 -0800
+++ b/libpurple/protocols/yahoo/libymsg.c Sun Jan 19 11:30:49 2014 -0800
@@ -21,6 +21,12 @@
+ * Note: When handling the list of struct yahoo_pair's from an incoming + * packet the value might not be UTF-8. You should either validate that + * it is UTF-8 using g_utf8_validate() or use yahoo_string_decode(). @@ -592,14 +598,24 @@
yd->current_list15_grp = yahoo_string_decode(gc, pair->value, FALSE);
case 7: /* buddy's s/n */
- temp = g_strdup(purple_normalize(account, pair->value));
+ if (g_utf8_validate(pair->value, -1, NULL)) { + temp = g_strdup(purple_normalize(account, pair->value)); + purple_debug_warning("yahoo", "yahoo_process_list_15 " + "got non-UTF-8 string for key %d\n", pair->key); case 241: /* user on federated network */
fed = strtol(pair->value, NULL, 10);
case 59: /* somebody told cookies come here too, but im not sure */
- yahoo_process_cookie(yd, pair->value);
+ if (g_utf8_validate(pair->value, -1, NULL)) { + yahoo_process_cookie(yd, pair->value); + purple_debug_warning("yahoo", "yahoo_process_list_15 " + "got non-UTF-8 string for key %d\n", pair->key); case 317: /* Stealth Setting */
stealth = strtol(pair->value, NULL, 10);
@@ -662,22 +678,42 @@
g_string_append(yd->tmp_serv_blist, pair->value);
- if (!yd->tmp_serv_ilist)
- yd->tmp_serv_ilist = g_string_new(pair->value);
- g_string_append(yd->tmp_serv_ilist, pair->value);
+ if (g_utf8_validate(pair->value, -1, NULL)) { + if (!yd->tmp_serv_ilist) + yd->tmp_serv_ilist = g_string_new(pair->value); + g_string_append(yd->tmp_serv_ilist, pair->value); + purple_debug_warning("yahoo", "yahoo_process_list " + "got non-UTF-8 string for key %d\n", pair->key); - yd->profiles = g_strsplit(pair->value, ",", -1);
+ if (g_utf8_validate(pair->value, -1, NULL)) { + yd->profiles = g_strsplit(pair->value, ",", -1); + purple_debug_warning("yahoo", "yahoo_process_list " + "got non-UTF-8 string for key %d\n", pair->key); case 59: /* cookies, yum */
- yahoo_process_cookie(yd, pair->value);
+ if (g_utf8_validate(pair->value, -1, NULL)) { + yahoo_process_cookie(yd, pair->value); + purple_debug_warning("yahoo", "yahoo_process_list " + "got non-UTF-8 string for key %d\n", pair->key); case YAHOO_SERVICE_PRESENCE_PERM:
- if (!yd->tmp_serv_plist)
- yd->tmp_serv_plist = g_string_new(pair->value);
- g_string_append(yd->tmp_serv_plist, pair->value);
+ if (g_utf8_validate(pair->value, -1, NULL)) { + if (!yd->tmp_serv_plist) + yd->tmp_serv_plist = g_string_new(pair->value); + g_string_append(yd->tmp_serv_plist, pair->value); + purple_debug_warning("yahoo", "yahoo_process_list " + "got non-UTF-8 string for key %d\n", pair->key); @@ -700,6 +736,12 @@
grp = yahoo_string_decode(gc, split[0], FALSE);
buddies = g_strsplit(split[1], ",", -1);
for (bud = buddies; bud && *bud; bud++) {
+ if (!g_utf8_validate(*bud, -1, NULL)) { + purple_debug_warning("yahoo", "yahoo_process_list " + "got non-UTF-8 string for bud\n"); norm_bud = g_strdup(purple_normalize(account, *bud));
f = yahoo_friend_find_or_new(gc, norm_bud);
@@ -794,14 +836,26 @@
struct yahoo_pair *pair = l->data;
- if (pair->key == 4 || pair->key == 1)
+ if (pair->key == 4 || pair->key == 1) { + if (g_utf8_validate(pair->value, -1, NULL)) { + purple_debug_warning("yahoo", "yahoo_process_notify " + "got non-UTF-8 string for key %d\n", pair->key);
+ if (g_utf8_validate(pair->value, -1, NULL)) { + purple_debug_warning("yahoo", "yahoo_process_notify " + "got non-UTF-8 string for key %d\n", pair->key); val_11 = strtol(pair->value, NULL, 10);
@@ -905,10 +959,15 @@
struct yahoo_pair *pair = l->data;
- sms = g_new0(struct _yahoo_im, 1);
- sms->from = g_strdup_printf("+%s", pair->value);
- sms->time = time(NULL);
+ if (g_utf8_validate(pair->value, -1, NULL)) { + sms = g_new0(struct _yahoo_im, 1); + sms->from = g_strdup_printf("+%s", pair->value); + sms->time = time(NULL); + purple_debug_warning("yahoo", "yahoo_process_sms_message " + "got non-UTF-8 string for key %d\n", pair->key); @@ -917,8 +976,14 @@
g_hash_table_insert(yd->sms_carrier, g_strdup(sms->from), g_strdup(pair->value));
- server_msg = pair->value;
+ if (g_utf8_validate(pair->value, -1, NULL)) { + server_msg = pair->value; + purple_debug_warning("yahoo", "yahoo_process_sms_message " + "got non-UTF-8 string for key %d\n", pair->key); @@ -972,13 +1037,18 @@
struct yahoo_pair *pair = l->data;
if (pair->key == 4 || pair->key == 1) {
- im = g_new0(struct _yahoo_im, 1);
- list = g_slist_append(list, im);
- im->from = pair->value;
- im->fed = YAHOO_FEDERATION_NONE;
- im->fed_from = g_strdup(im->from);
+ if (g_utf8_validate(pair->value, -1, NULL)) { + im = g_new0(struct _yahoo_im, 1); + list = g_slist_append(list, im); + im->from = pair->value; + im->fed = YAHOO_FEDERATION_NONE; + im->fed_from = g_strdup(im->from); + purple_debug_warning("yahoo", "yahoo_process_message " + "got non-UTF-8 string for key %d\n", pair->key); if (im && pair->key == 5)
im->active_id = pair->value;
@@ -1034,7 +1104,7 @@
- if (im && pair->key == 63)
+ if (im && pair->key == 63 && g_utf8_validate(pair->value, -1, NULL)) /* Check for the Doodle IMV, no IMvironment for federated buddies */
if (im->from != NULL && im->fed == YAHOO_FEDERATION_NONE)
@@ -1170,10 +1240,22 @@
struct yahoo_pair *pair = l->data;
+ if (g_utf8_validate(pair->value, -1, NULL)) { + purple_debug_warning("yahoo", "yahoo_process_sysmessage " + "got non-UTF-8 string for key %d\n", pair->key); + if (g_utf8_validate(pair->value, -1, NULL)) { + purple_debug_warning("yahoo", "yahoo_process_sysmessage " + "got non-UTF-8 string for key %d\n", pair->key); @@ -1331,7 +1413,12 @@
+ if (g_utf8_validate(pair->value, -1, NULL)) { + purple_debug_warning("yahoo", "yahoo_buddy_auth_req_15 " + "got non-UTF-8 string for key %d\n", pair->key); response = strtol(pair->value, NULL, 10);
@@ -1386,22 +1473,42 @@
+ if (g_utf8_validate(pair->value, -1, NULL)) { + purple_debug_warning("yahoo", "yahoo_buddy_auth_req_15 " + "got non-UTF-8 string for key %d\n", pair->key); - add_req->id = g_strdup(pair->value);
+ if (g_utf8_validate(pair->value, -1, NULL)) { + add_req->id = g_strdup(pair->value); + purple_debug_warning("yahoo", "yahoo_buddy_auth_req_15 " + "got non-UTF-8 string for key %d\n", pair->key); - firstname = pair->value;
+ if (g_utf8_validate(pair->value, -1, NULL)) { + firstname = pair->value; + purple_debug_warning("yahoo", "yahoo_buddy_auth_req_15 " + "got non-UTF-8 string for key %d\n", pair->key); add_req->fed = strtol(pair->value, NULL, 10);
- lastname = pair->value;
+ if (g_utf8_validate(pair->value, -1, NULL)) { + lastname = pair->value; + purple_debug_warning("yahoo", "yahoo_buddy_auth_req_15 " + "got non-UTF-8 string for key %d\n", pair->key); @@ -1482,10 +1589,20 @@
- add_req->id = g_strdup(pair->value);
+ if (g_utf8_validate(pair->value, -1, NULL)) { + add_req->id = g_strdup(pair->value); + purple_debug_warning("yahoo", "yahoo_buddy_added_us " + "got non-UTF-8 string for key %d\n", pair->key); - add_req->who = g_strdup(pair->value);
+ if (g_utf8_validate(pair->value, -1, NULL)) { + add_req->who = g_strdup(pair->value); + purple_debug_warning("yahoo", "yahoo_buddy_added_us " + "got non-UTF-8 string for key %d\n", pair->key); case 15: /* time, for when they add us and we're offline */
@@ -1537,10 +1654,20 @@
+ if (g_utf8_validate(pair->value, -1, NULL)) { + purple_debug_warning("yahoo", "yahoo_buddy_denied_our_add_old " + "got non-UTF-8 string for key %d\n", pair->key);
+ if (g_utf8_validate(pair->value, -1, NULL)) { + purple_debug_warning("yahoo", "yahoo_buddy_denied_our_add_old " + "got non-UTF-8 string for key %d\n", pair->key); @@ -1637,12 +1764,28 @@
struct yahoo_pair *pair = l->data;
count = strtol(pair->value, NULL, 10);
- else if (pair->key == 43)
- else if (pair->key == 42)
- else if (pair->key == 18)
+ else if (pair->key == 43) { + if (g_utf8_validate(pair->value, -1, NULL)) { + purple_debug_warning("yahoo", "yahoo_process_mail " + "got non-UTF-8 string for key %d\n", pair->key); + } else if (pair->key == 42) { + if (g_utf8_validate(pair->value, -1, NULL)) { + purple_debug_warning("yahoo", "yahoo_process_mail " + "got non-UTF-8 string for key %d\n", pair->key); + } else if (pair->key == 18) { + if (g_utf8_validate(pair->value, -1, NULL)) { + purple_debug_warning("yahoo", "yahoo_process_mail " + "got non-UTF-8 string for key %d\n", pair->key); @@ -2077,10 +2220,22 @@
struct yahoo_pair *pair = l->data;
+ if (g_utf8_validate(pair->value, -1, NULL)) { + purple_debug_warning("yahoo", "yahoo_process_auth " + "got non-UTF-8 string for key %d\n", pair->key); + if (g_utf8_validate(pair->value, -1, NULL)) { + purple_debug_warning("yahoo", "yahoo_process_auth " + "got non-UTF-8 string for key %d\n", pair->key); @@ -2152,10 +2307,20 @@
struct yahoo_pair *pair = l->data;
+ if (g_utf8_validate(pair->value, -1, NULL)) { + purple_debug_warning("yahoo", "yahoo_process_ignore " + "got non-UTF-8 string for key %d\n", pair->key);
+ if (g_utf8_validate(pair->value, -1, NULL)) { + purple_debug_warning("yahoo", "yahoo_process_ignore " + "got non-UTF-8 string for key %d\n", pair->key); /* 1 == ignore, 2 == unignore */
@@ -2224,8 +2389,14 @@
err = strtol(pair->value, NULL, 10);
- else if (pair->key == 20)
+ else if (pair->key == 20) { + if (g_utf8_validate(pair->value, -1, NULL)) { + purple_debug_warning("yahoo", "yahoo_process_authresp " + "got non-UTF-8 string for key %d\n", pair->key); @@ -2313,7 +2484,12 @@
err = strtol(pair->value, NULL, 10);
+ if (g_utf8_validate(pair->value, -1, NULL)) { + purple_debug_warning("yahoo", "yahoo_process_addbuddy " + "got non-UTF-8 string for key %d\n", pair->key); @@ -2470,11 +2646,16 @@
- if(strncmp(who, p2p_data->host_username, strlen(p2p_data->host_username)) != 0) {
- /* from whom are we receiving the packets ?? */
- purple_debug_warning("yahoo","p2p: received data from wrong user\n");
+ if (g_utf8_validate(pair->value, -1, NULL)) { + if(strncmp(who, p2p_data->host_username, strlen(p2p_data->host_username)) != 0) { + /* from whom are we receiving the packets ?? */ + purple_debug_warning("yahoo","p2p: received data from wrong user\n"); + purple_debug_warning("yahoo", "yahoo_p2p_process_p2pfilexfer " + "got non-UTF-8 string for key %d\n", pair->key); @@ -2863,15 +3044,25 @@
+ if (g_utf8_validate(pair->value, -1, NULL)) { + purple_debug_warning("yahoo", "yahoo_process_p2p " + "got non-UTF-8 string for key %d\n", pair->key); /* who again, the master identity this time? */
- /* so, this is an ip address. in base64. decoded it's in ascii.
- after strtol, it's in reversed byte order. Who thought this up?*/
+ if (g_utf8_validate(pair->value, -1, NULL)) { + /* so, this is an ip address. in base64. decoded it's in ascii. + after strtol, it's in reversed byte order. Who thought this up?*/ + purple_debug_warning("yahoo", "yahoo_process_p2p " + "got non-UTF-8 string for key %d\n", pair->key); val_13 = strtol(pair->value, NULL, 10);
@@ -2960,7 +3151,12 @@
+ if (g_utf8_validate(pair->value, -1, NULL)) { + purple_debug_warning("yahoo", "yahoo_process_audible " + "got non-UTF-8 string for key %d\n", pair->key); @@ -2968,11 +3164,21 @@
/* the audible, in foo.locale.bar.baz format
eg: base.tw.smiley.smiley43 */
+ if (g_utf8_validate(pair->value, -1, NULL)) { + purple_debug_warning("yahoo", "yahoo_process_audible " + "got non-UTF-8 string for key %d\n", pair->key); /* the text of the audible */
+ if (g_utf8_validate(pair->value, -1, NULL)) { + purple_debug_warning("yahoo", "yahoo_process_audible " + "got non-UTF-8 string for key %d\n", pair->key); /* SHA-1 hash of audible SWF file (eg: 4e8691499d9c0fb8374478ff9720f4a9ea4a4915) */
--- a/libpurple/protocols/yahoo/yahoo_filexfer.c Sat Jan 18 16:30:55 2014 -0800
+++ b/libpurple/protocols/yahoo/yahoo_filexfer.c Sun Jan 19 11:30:49 2014 -0800
@@ -749,25 +749,60 @@
case 5: /* Get who the packet is for */
+ if (g_utf8_validate(pair->value, -1, NULL)) { + purple_debug_warning("yahoo", "yahoo_process_p2pfilexfer " + "got non-UTF-8 string for key %d\n", pair->key); case 4: /* Get who the packet is from */
+ if (g_utf8_validate(pair->value, -1, NULL)) { + purple_debug_warning("yahoo", "yahoo_process_p2pfilexfer " + "got non-UTF-8 string for key %d\n", pair->key); case 49: /* Get the type of service */
+ if (g_utf8_validate(pair->value, -1, NULL)) { + purple_debug_warning("yahoo", "yahoo_process_p2pfilexfer " + "got non-UTF-8 string for key %d\n", pair->key); case 14: /* Get the 'message' of the packet */
+ if (g_utf8_validate(pair->value, -1, NULL)) { + purple_debug_warning("yahoo", "yahoo_process_p2pfilexfer " + "got non-UTF-8 string for key %d\n", pair->key); case 13: /* Get the command associated with this packet */
+ if (g_utf8_validate(pair->value, -1, NULL)) { + purple_debug_warning("yahoo", "yahoo_process_p2pfilexfer " + "got non-UTF-8 string for key %d\n", pair->key); case 63: /* IMVironment name and version */
+ if (g_utf8_validate(pair->value, -1, NULL)) { + purple_debug_warning("yahoo", "yahoo_process_p2pfilexfer " + "got non-UTF-8 string for key %d\n", pair->key); case 64: /* Not sure, but it does vary with initialization of Doodle */
- unknown = pair->value; /* So, I'll keep it (for a little while atleast) */
+ if (g_utf8_validate(pair->value, -1, NULL)) { + unknown = pair->value; /* So, I'll keep it (for a little while atleast) */ + purple_debug_warning("yahoo", "yahoo_process_p2pfilexfer " + "got non-UTF-8 string for key %d\n", pair->key); @@ -813,16 +848,36 @@
+ if (g_utf8_validate(pair->value, -1, NULL)) { + purple_debug_warning("yahoo", "yahoo_process_filetransfer " + "got non-UTF-8 string for key %d\n", pair->key);
+ if (g_utf8_validate(pair->value, -1, NULL)) { + purple_debug_warning("yahoo", "yahoo_process_filetransfer " + "got non-UTF-8 string for key %d\n", pair->key);
+ if (g_utf8_validate(pair->value, -1, NULL)) { + purple_debug_warning("yahoo", "yahoo_process_filetransfer " + "got non-UTF-8 string for key %d\n", pair->key);
+ if (g_utf8_validate(pair->value, -1, NULL)) { + purple_debug_warning("yahoo", "yahoo_process_filetransfer " + "got non-UTF-8 string for key %d\n", pair->key); expires = strtol(pair->value, NULL, 10);
@@ -834,10 +889,20 @@
filesize = atol(pair->value);
+ if (g_utf8_validate(pair->value, -1, NULL)) { + purple_debug_warning("yahoo", "yahoo_process_filetransfer " + "got non-UTF-8 string for key %d\n", pair->key);
+ if (g_utf8_validate(pair->value, -1, NULL)) { + purple_debug_warning("yahoo", "yahoo_process_filetransfer " + "got non-UTF-8 string for key %d\n", pair->key); @@ -1616,20 +1681,40 @@
+ if (g_utf8_validate(pair->value, -1, NULL)) { + purple_debug_warning("yahoo", "yahoo_process_filetrans_15 " + "got non-UTF-8 string for key %d\n", pair->key);
+ if (g_utf8_validate(pair->value, -1, NULL)) { + purple_debug_warning("yahoo", "yahoo_process_filetrans_15 " + "got non-UTF-8 string for key %d\n", pair->key); - xfer_peer_idstring = pair->value;
+ if (g_utf8_validate(pair->value, -1, NULL)) { + xfer_peer_idstring = pair->value; + purple_debug_warning("yahoo", "yahoo_process_filetrans_15 " + "got non-UTF-8 string for key %d\n", pair->key); filename_list = g_slist_prepend(filename_list, g_strdup(pair->value));
- size_list = g_slist_prepend(size_list, g_strdup(pair->value));
+ if (g_utf8_validate(pair->value, -1, NULL)) { + size_list = g_slist_prepend(size_list, g_strdup(pair->value)); + purple_debug_warning("yahoo", "yahoo_process_filetrans_15 " + "got non-UTF-8 string for key %d\n", pair->key); val_222 = atol(pair->value);
@@ -1638,10 +1723,20 @@
/* check for p2p and imviron .... not sure it comes by this service packet. Since it was bundled with filexfer in old ymsg version, still keeping it. */
+ if (g_utf8_validate(pair->value, -1, NULL)) { + purple_debug_warning("yahoo", "yahoo_process_filetrans_15 " + "got non-UTF-8 string for key %d\n", pair->key);
+ if (g_utf8_validate(pair->value, -1, NULL)) { + purple_debug_warning("yahoo", "yahoo_process_filetrans_15 " + "got non-UTF-8 string for key %d\n", pair->key); @@ -1803,7 +1898,12 @@
- xfer_peer_idstring = pair->value;
+ if (g_utf8_validate(pair->value, -1, NULL)) { + xfer_peer_idstring = pair->value; + purple_debug_warning("yahoo", "yahoo_process_filetrans_info_15 " + "got non-UTF-8 string for key %d\n", pair->key); @@ -1816,10 +1916,20 @@
/* 249 has value 1 or 2 when doing p2p transfer and value 3 when relaying through yahoo server */
+ if (g_utf8_validate(pair->value, -1, NULL)) { + purple_debug_warning("yahoo", "yahoo_process_filetrans_info_15 " + "got non-UTF-8 string for key %d\n", pair->key); - xfer_idstring_for_relay = pair->value;
+ if (g_utf8_validate(pair->value, -1, NULL)) { + xfer_idstring_for_relay = pair->value; + purple_debug_warning("yahoo", "yahoo_process_filetrans_info_15 " + "got non-UTF-8 string for key %d\n", pair->key); @@ -1902,10 +2012,20 @@
- xfer_idstring_for_relay = pair->value;
+ if (g_utf8_validate(pair->value, -1, NULL)) { + xfer_idstring_for_relay = pair->value; + purple_debug_warning("yahoo", "yahoo_process_filetrans_acc_15 " + "got non-UTF-8 string for key %d\n", pair->key); - xfer_peer_idstring = pair->value;
+ if (g_utf8_validate(pair->value, -1, NULL)) { + xfer_peer_idstring = pair->value; + purple_debug_warning("yahoo", "yahoo_process_filetrans_acc_15 " + "got non-UTF-8 string for key %d\n", pair->key); val_66 = atol(pair->value);
@@ -1914,7 +2034,13 @@
val_249 = atol(pair->value);
- url = pair->value; /* we get a p2p url here when sending file, connected as client */
+ if (g_utf8_validate(pair->value, -1, NULL)) { + /* we get a p2p url here when sending file, connected as client */ + purple_debug_warning("yahoo", "yahoo_process_filetrans_acc_15 " + "got non-UTF-8 string for key %d\n", pair->key); --- a/libpurple/protocols/yahoo/yahoochat.c Sat Jan 18 16:30:55 2014 -0800
+++ b/libpurple/protocols/yahoo/yahoochat.c Sun Jan 19 11:30:49 2014 -0800
@@ -156,15 +156,25 @@
room = yahoo_string_decode(gc, pair->value, FALSE);
- g_string_append_printf(members, "%s\n", who);
+ if (g_utf8_validate(pair->value, -1, NULL)) { + g_string_append_printf(members, "%s\n", who); + purple_debug_warning("yahoo", "yahoo_process_conference_invite " + "got non-UTF-8 string for key %d\n", pair->key); case 51: /* This user is being invited to the conference. Comes with status = 11, so we wont reach here */
case 52: /* Invited users. Assuming us invited, since we got this packet */
break; /* break needed, or else we add the users to the conference before they accept the invitation */
case 53: /* members who have already joined the conference */
- g_string_append_printf(members, "%s\n", pair->value);
+ if (g_utf8_validate(pair->value, -1, NULL)) { + g_string_append_printf(members, "%s\n", pair->value); + purple_debug_warning("yahoo", "yahoo_process_conference_invite " + "got non-UTF-8 string for key %d\n", pair->key); @@ -220,7 +230,12 @@
room = yahoo_string_decode(gc, pair->value, FALSE);
+ if (g_utf8_validate(pair->value, -1, NULL)) { + purple_debug_warning("yahoo", "yahoo_process_conference_decline " + "got non-UTF-8 string for key %d\n", pair->key); @@ -277,7 +292,12 @@
room = yahoo_string_decode(gc, pair->value, FALSE);
+ if (g_utf8_validate(pair->value, -1, NULL)) { + purple_debug_warning("yahoo", "yahoo_process_conference_logon " + "got non-UTF-8 string for key %d\n", pair->key); @@ -309,7 +329,12 @@
room = yahoo_string_decode(gc, pair->value, FALSE);
+ if (g_utf8_validate(pair->value, -1, NULL)) { + purple_debug_warning("yahoo", "yahoo_process_conference_logoff " + "got non-UTF-8 string for key %d\n", pair->key); @@ -340,7 +365,12 @@
room = yahoo_string_decode(gc, pair->value, FALSE);
+ if (g_utf8_validate(pair->value, -1, NULL)) { + purple_debug_warning("yahoo", "yahoo_process_conference_message " + "got non-UTF-8 string for key %d\n", pair->key); @@ -506,18 +536,38 @@
topic = yahoo_string_decode(gc, pair->value, TRUE);
+ if (g_utf8_validate(pair->value, -1, NULL)) { + purple_debug_warning("yahoo", "yahoo_process_chat_join " + "got non-UTF-8 string for key %d\n", pair->key); case 108: /* number of joiners */
- someotherid = pair->value;
+ if (g_utf8_validate(pair->value, -1, NULL)) { + someotherid = pair->value; + purple_debug_warning("yahoo", "yahoo_process_chat_join " + "got non-UTF-8 string for key %d\n", pair->key); - somebase64orhashosomething = pair->value;
+ if (g_utf8_validate(pair->value, -1, NULL)) { + somebase64orhashosomething = pair->value; + purple_debug_warning("yahoo", "yahoo_process_chat_join " + "got non-UTF-8 string for key %d\n", pair->key); - somenegativenumber = pair->value;
+ if (g_utf8_validate(pair->value, -1, NULL)) { + somenegativenumber = pair->value; + purple_debug_warning("yahoo", "yahoo_process_chat_join " + "got non-UTF-8 string for key %d\n", pair->key); case 13: /* this is 1. maybe its the type of room? (normal, user created, private, etc?) */
@@ -528,7 +578,12 @@
info about individual room members, (including us) */
case 109: /* the yahoo id */
- members = g_list_append(members, pair->value);
+ if (g_utf8_validate(pair->value, -1, NULL)) { + members = g_list_append(members, pair->value); + purple_debug_warning("yahoo", "yahoo_process_chat_join " + "got non-UTF-8 string for key %d\n", pair->key); @@ -625,8 +680,14 @@
room = yahoo_string_decode(gc, pair->value, TRUE);
+ if (pair->key == 109) { + if (g_utf8_validate(pair->value, -1, NULL)) { + purple_debug_warning("yahoo", "yahoo_process_chat_exit " + "got non-UTF-8 string for key %d\n", pair->key); @@ -658,10 +719,20 @@
room = yahoo_string_decode(gc, pair->value, TRUE);
+ if (g_utf8_validate(pair->value, -1, NULL)) { + purple_debug_warning("yahoo", "yahoo_process_chat_message " + "got non-UTF-8 string for key %d\n", pair->key);
+ if (g_utf8_validate(pair->value, -1, NULL)) { + purple_debug_warning("yahoo", "yahoo_process_chat_message " + "got non-UTF-8 string for key %d\n", pair->key); msgtype = strtol(pair->value, NULL, 10);
@@ -724,7 +795,12 @@
msg = yahoo_string_decode(gc, pair->value, FALSE);
+ if (g_utf8_validate(pair->value, -1, NULL)) { + purple_debug_warning("yahoo", "yahoo_process_chat_addinvite " + "got non-UTF-8 string for key %d\n", pair->key);