Gentoo Archives: gentoo-commits

From: "Peter Alfredsen (loki_val)" <loki_val@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in net-libs/libtorrent/files: libtorrent-0.12.3-fix-fill_read_buffer-overflow.patch
Date: Sun, 02 Nov 2008 15:35:58
Message-Id: E1Kwezb-0006Sp-U1@stork.gentoo.org
1 loki_val 08/11/02 15:35:55
2
3 Added:
4 libtorrent-0.12.3-fix-fill_read_buffer-overflow.patch
5 Log:
6 Fix 'Handshake buffer overflows', upstream ticket 1337: http://libtorrent.rakshasa.no/ticket/1337
7 (Portage version: 2.2_rc13/cvs/Linux 2.6.27 x86_64)
8
9 Revision Changes Path
10 1.1 net-libs/libtorrent/files/libtorrent-0.12.3-fix-fill_read_buffer-overflow.patch
11
12 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-libs/libtorrent/files/libtorrent-0.12.3-fix-fill_read_buffer-overflow.patch?rev=1.1&view=markup
13 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-libs/libtorrent/files/libtorrent-0.12.3-fix-fill_read_buffer-overflow.patch?rev=1.1&content-type=text/plain
14
15 Index: libtorrent-0.12.3-fix-fill_read_buffer-overflow.patch
16 ===================================================================
17 # Fixes a crash with fill_read_buffer(...) Buffer overflow" if peer sends
18 # both encryption pads and their total size does not allow the subsequent
19 # bitfield/protocol message to be received correctly. Ticket #1337.
20 Index: libtorrent/src/protocol/handshake.h
21 ===================================================================
22 --- libtorrent/src/protocol/handshake.h (revision 1073)
23 +++ libtorrent/src/protocol/handshake.h (working copy)
24 @@ -66,7 +66,7 @@
25 static const uint32_t enc_pad_size = 512;
26 static const uint32_t enc_pad_read_size = 96 + enc_pad_size + 20;
27
28 - static const uint32_t buffer_size = enc_pad_read_size + 20 + enc_negotiation_size + enc_pad_size + 2 + handshake_size;
29 + static const uint32_t buffer_size = enc_pad_read_size + 20 + enc_negotiation_size + enc_pad_size + 2 + handshake_size + 5;
30
31 typedef ProtocolBuffer<buffer_size> Buffer;