soc.2008.yahoo: 182668e3: clearing conflicts while merging from im...
sulabh at soc.pidgin.im
sulabh at soc.pidgin.im
Tue Jan 20 13:12:28 EST 2009
-----------------------------------------------------------------
Revision: 182668e30410a6c12e970fad010f219ee6b59e73
Ancestor: dbb1e8a3e276d9b2a3e4f485a1e3b33f97c4f2e3
Author: sulabh at soc.pidgin.im
Date: 2009-01-20T17:11:35
Branch: im.pidgin.soc.2008.yahoo
URL: http://d.pidgin.im/viewmtn/revision/info/182668e30410a6c12e970fad010f219ee6b59e73
Modified files:
libpurple/protocols/yahoo/yahoo.c
ChangeLog:
clearing conflicts while merging from im.pidgin.pidgin to im.pidgin.soc.2008.yahoo
-------------- next part --------------
============================================================
--- libpurple/protocols/yahoo/yahoo.c 09f775189d749820ca7f31a290e59e322d0edbaf
+++ libpurple/protocols/yahoo/yahoo.c 07cc19c2eb915edfad50ec751f83364a6c159286
@@ -4435,10 +4435,28 @@ static int yahoo_send_im(PurpleConnectio
PurpleWhiteboard *wb;
int ret = 1;
YahooFriend *f = NULL;
+ gsize lenb = 0;
+ glong lenc = 0;
struct yahoo_p2p_data *p2p_data;
gboolean wlm = FALSE;
msg2 = yahoo_string_encode(gc, msg, &utf8);
+ if(msg2) {
+ lenb = strlen(msg2);
+ lenc = g_utf8_strlen(msg2, -1);
+
+ if(lenb > YAHOO_MAX_MESSAGE_LENGTH_BYTES || lenc > YAHOO_MAX_MESSAGE_LENGTH_CHARS) {
+ purple_debug_info("yahoo", "Message too big. Length is %" G_GSIZE_FORMAT
+ " bytes, %ld characters. Max is %d bytes, %d chars."
+ " Message is '%s'.\n", lenb, lenc, YAHOO_MAX_MESSAGE_LENGTH_BYTES,
+ YAHOO_MAX_MESSAGE_LENGTH_CHARS, msg2);
+ yahoo_packet_free(pkt);
+ g_free(msg);
+ g_free(msg2);
+ return -E2BIG;
+ }
+ }
+
wlm = g_str_has_prefix(who, "wlm/") || g_str_has_prefix(who, "WLM/");
if( strncmp(who, "+", 1) == 0 ) {
More information about the Commits
mailing list