summaryrefslogtreecommitdiff
path: root/net-im
diff options
context:
space:
mode:
authorOlivier Crête <tester@gentoo.org>2009-02-20 17:23:27 +0000
committerOlivier Crête <tester@gentoo.org>2009-02-20 17:23:27 +0000
commita8c79f35e3dda1ede4f03129b6c06540075f2387 (patch)
tree62abe4b85153061a79cd30829173b8ebe58bfceb /net-im
parentStable on alpha, bug #258450 (diff)
downloadgentoo-2-a8c79f35e3dda1ede4f03129b6c06540075f2387.tar.gz
gentoo-2-a8c79f35e3dda1ede4f03129b6c06540075f2387.tar.bz2
gentoo-2-a8c79f35e3dda1ede4f03129b6c06540075f2387.zip
Add patch for ICQ charset stuff, bug #235541
(Portage version: 2.1.6.4/cvs/Linux 2.6.26-gentoo-r1 x86_64)
Diffstat (limited to 'net-im')
-rw-r--r--net-im/pidgin/ChangeLog6
-rw-r--r--net-im/pidgin/files/pidgin-2.5.4-icq-messages-magic.patch82
-rw-r--r--net-im/pidgin/pidgin-2.5.4-r1.ebuild3
3 files changed, 89 insertions, 2 deletions
diff --git a/net-im/pidgin/ChangeLog b/net-im/pidgin/ChangeLog
index ac44fe6265c7..3dd7bfe7ef25 100644
--- a/net-im/pidgin/ChangeLog
+++ b/net-im/pidgin/ChangeLog
@@ -1,6 +1,10 @@
# ChangeLog for net-im/pidgin
# Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/net-im/pidgin/ChangeLog,v 1.84 2009/02/08 13:17:40 drizzt Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-im/pidgin/ChangeLog,v 1.85 2009/02/20 17:23:27 tester Exp $
+
+ 20 Feb 2009; Olivier Crête <tester@gentoo.org>
+ +files/pidgin-2.5.4-icq-messages-magic.patch, pidgin-2.5.4-r1.ebuild:
+ Add patch for ICQ charset stuff, bug #235541
*pidgin-2.5.4-r1 (08 Feb 2009)
diff --git a/net-im/pidgin/files/pidgin-2.5.4-icq-messages-magic.patch b/net-im/pidgin/files/pidgin-2.5.4-icq-messages-magic.patch
new file mode 100644
index 000000000000..542857fac7b0
--- /dev/null
+++ b/net-im/pidgin/files/pidgin-2.5.4-icq-messages-magic.patch
@@ -0,0 +1,82 @@
+#
+#
+# patch "libpurple/protocols/oscar/family_icbm.c"
+# from [80ce9708420fc9a68491d504ae265384ff5a63c9]
+# to [18ddbc7d86612fd9ae5917928b5835df2aae50b8]
+#
+============================================================
+--- libpurple/protocols/oscar/family_icbm.c 80ce9708420fc9a68491d504ae265384ff5a63c9
++++ libpurple/protocols/oscar/family_icbm.c 18ddbc7d86612fd9ae5917928b5835df2aae50b8
+@@ -1566,9 +1566,10 @@ static int incomingim_ch1(OscarData *od,
+
+ static int incomingim_ch1(OscarData *od, FlapConnection *conn, aim_module_t *mod, FlapFrame *frame, aim_modsnac_t *snac, guint16 channel, aim_userinfo_t *userinfo, ByteStream *bs, guint8 *cookie)
+ {
+- guint16 type, length;
++ guint16 type, length, magic1, msglen;
+ aim_rxcallback_t userfunc;
+ int ret = 0;
++ int rev = 0;
+ struct aim_incomingim_ch1_args args;
+ unsigned int endpos;
+
+@@ -1603,11 +1604,31 @@ static int incomingim_ch1(OscarData *od,
+ * - 0101 -- Unknown
+ * - Message
+ *
++ * Slick and possible others reverse 'Features' and 'Messages' section.
++ * Thus, the TLV could have following layout:
++ * - 0101 -- Unknown (possibly magic for message section)
++ * - Message
++ * - 0501 -- Unknown (possibly magic for features section)
++ * - Features: Don't know how to interpret these
+ */
+
+- byte_stream_get8(bs); /* 05 */
+- byte_stream_get8(bs); /* 01 */
++ magic1 = byte_stream_get16(bs); /* 0501 or 0101 */
++ if (magic1 == 0x101) /* Bad, message comes before attributes */
++ {
++ /* Jump to the features section */
++ msglen = byte_stream_get16(bs);
++ bs->offset += msglen;
++ rev = 1;
+
++ magic1 = byte_stream_get16(bs); /* 0501 */
++ }
++
++ if (magic1 != 0x501)
++ {
++ purple_debug_misc("oscar", "Received an IM containing an invalid message part from %s. They are probably trying to do something malicious.\n", userinfo->sn);
++ break;
++ }
++
+ args.featureslen = byte_stream_get16(bs);
+ if (args.featureslen > byte_stream_empty(bs))
+ {
+@@ -1624,11 +1645,25 @@ static int incomingim_ch1(OscarData *od,
+ args.icbmflags |= AIM_IMFLAGS_CUSTOMFEATURES;
+ }
+
++ if (rev)
++ {
++ /* Fix buffer back to message */
++ bs->offset -= args.featureslen + 2 + 2 + msglen + 2 + 2;
++ }
++
++ magic1 = byte_stream_get16(bs); /* 01 01 */
++ if (magic1 != 0x101) /* Bad, message comes before attributes */
++ {
++ purple_debug_misc("oscar", "Received an IM containing an invalid message part from %s. They are probably trying to do something malicious.\n", userinfo->sn);
++ break;
++ }
++ msglen = byte_stream_get16(bs);
++
+ /*
+ * The rest of the TLV contains one or more message
+ * blocks...
+ */
+- incomingim_ch1_parsemsgs(od, userinfo, bs->data + bs->offset /* XXX evil!!! */, length - 2 - 2 - args.featureslen, &args);
++ incomingim_ch1_parsemsgs(od, userinfo, bs->data + bs->offset - 2 - 2 /* XXX evil!!! */, msglen + 2 + 2, &args);
+
+ } else if (type == 0x0003) { /* Server Ack Requested */
+
diff --git a/net-im/pidgin/pidgin-2.5.4-r1.ebuild b/net-im/pidgin/pidgin-2.5.4-r1.ebuild
index 9bb4fca3e871..e81b8fc2d26b 100644
--- a/net-im/pidgin/pidgin-2.5.4-r1.ebuild
+++ b/net-im/pidgin/pidgin-2.5.4-r1.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/net-im/pidgin/pidgin-2.5.4-r1.ebuild,v 1.1 2009/02/08 13:17:40 drizzt Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-im/pidgin/pidgin-2.5.4-r1.ebuild,v 1.2 2009/02/20 17:23:27 tester Exp $
EAPI=2
@@ -85,6 +85,7 @@ pkg_setup() {
src_prepare() {
epatch "${FILESDIR}"/${P}-icq.patch
+ epatch "${FILESDIR}"/${P}-icq-messages-magic.patch
}
src_configure() {