pidgin: 9655e74f: yahoo: Avoid misuse of purple_normalize
darkrain42 at pidgin.im
darkrain42 at pidgin.im
Wed Aug 4 07:39:19 EDT 2010
----------------------------------------------------------------------
Revision: 9655e74ffa6d13bf9ad73bdbd432f003c33cae79
Parent: 15918ce5d9936f807bc9de90658ac830d3b343f9
Author: darkrain42 at pidgin.im
Date: 08/01/10 16:21:20
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/9655e74ffa6d13bf9ad73bdbd432f003c33cae79
Changelog:
yahoo: Avoid misuse of purple_normalize
purple_normalize returns a pointer into a static buffer, so
calling it twice in the arguments to another function is bad.
(It was OK in this case, since the two calls were identical, but
let's avoid bad idioms)
Changes against parent 15918ce5d9936f807bc9de90658ac830d3b343f9
patched libpurple/protocols/yahoo/libymsg.c
-------------- next part --------------
============================================================
--- libpurple/protocols/yahoo/libymsg.c 6090714a7b0fb9c74656b7346d20c6be74c9176e
+++ libpurple/protocols/yahoo/libymsg.c a8de912ac1d3e210a98b1c3cc89d94eaced6b6b8
@@ -2702,6 +2702,7 @@ void yahoo_send_p2p_pkt(PurpleConnection
PurpleAccount *account;
YahooData *yd = gc->proto_data;
struct yahoo_p2p_data *p2p_data;
+ const char *norm_username;
f = yahoo_friend_find(gc, who);
account = purple_connection_get_account(gc);
@@ -2734,10 +2735,11 @@ void yahoo_send_p2p_pkt(PurpleConnection
sprintf(temp_str, "%d", ip);
base64_ip = purple_base64_encode( (guchar *)temp_str, strlen(temp_str) );
+ norm_username = purple_normalize(account, purple_account_get_username(account));
pkt = yahoo_packet_new(YAHOO_SERVICE_PEERTOPEER, YAHOO_STATUS_AVAILABLE, 0);
yahoo_packet_hash(pkt, "sssissis",
- 1, purple_normalize(account, purple_account_get_username(account)),
- 4, purple_normalize(account, purple_account_get_username(account)),
+ 1, norm_username,
+ 4, norm_username,
12, base64_ip, /* base64 encode ip */
61, 0, /* To-do : figure out what is 61 for?? */
2, "",
More information about the Commits
mailing list