summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Volkov <pva@gentoo.org>2010-10-29 13:41:07 +0000
committerPeter Volkov <pva@gentoo.org>2010-10-29 13:41:07 +0000
commita5b2c1a6855061e3bab9f484c305e69f2221d05b (patch)
treeee81cef8a8f48a75d0dd0babd884c544fcaadf55 /net-analyzer/tcpreplay
parentPatch sources to find documentation in the correct location. Bug #343117 (diff)
downloadgentoo-2-a5b2c1a6855061e3bab9f484c305e69f2221d05b.tar.gz
gentoo-2-a5b2c1a6855061e3bab9f484c305e69f2221d05b.tar.bz2
gentoo-2-a5b2c1a6855061e3bab9f484c305e69f2221d05b.zip
Fix buffer overflow (bug #336605) in stable version.
(Portage version: 2.1.9.22/cvs/Linux x86_64)
Diffstat (limited to 'net-analyzer/tcpreplay')
-rw-r--r--net-analyzer/tcpreplay/ChangeLog8
-rw-r--r--net-analyzer/tcpreplay/files/tcpreplay-3.4.4-crash.patch38
-rw-r--r--net-analyzer/tcpreplay/tcpreplay-3.4.4-r1.ebuild57
3 files changed, 102 insertions, 1 deletions
diff --git a/net-analyzer/tcpreplay/ChangeLog b/net-analyzer/tcpreplay/ChangeLog
index 7b7c59b51ea2..c8ef0dc5fecf 100644
--- a/net-analyzer/tcpreplay/ChangeLog
+++ b/net-analyzer/tcpreplay/ChangeLog
@@ -1,6 +1,12 @@
# ChangeLog for net-analyzer/tcpreplay
# Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/net-analyzer/tcpreplay/ChangeLog,v 1.40 2010/10/29 06:03:08 jer Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-analyzer/tcpreplay/ChangeLog,v 1.41 2010/10/29 13:41:07 pva Exp $
+
+*tcpreplay-3.4.4-r1 (29 Oct 2010)
+
+ 29 Oct 2010; Peter Volkov <pva@gentoo.org> +tcpreplay-3.4.4-r1.ebuild,
+ +files/tcpreplay-3.4.4-crash.patch:
+ Fix buffer overflow (bug #336605) in stable version.
*tcpreplay-3.4.5_beta2 (29 Oct 2010)
diff --git a/net-analyzer/tcpreplay/files/tcpreplay-3.4.4-crash.patch b/net-analyzer/tcpreplay/files/tcpreplay-3.4.4-crash.patch
new file mode 100644
index 000000000000..09875054fab7
--- /dev/null
+++ b/net-analyzer/tcpreplay/files/tcpreplay-3.4.4-crash.patch
@@ -0,0 +1,38 @@
+=== modified file 'src/common/cidr.c'
+--- src/common/cidr.c 2010-10-29 13:00:54 +0000
++++ src/common/cidr.c 2010-10-29 13:09:01 +0000
+@@ -85,11 +85,12 @@
+ destroy_cidr(tcpr_cidr_t * cidr)
+ {
+
+- if (cidr != NULL)
++ if (cidr != NULL) {
+ if (cidr->next != NULL)
+ destroy_cidr(cidr->next);
+
+- safe_free(cidr);
++ safe_free(cidr);
++ }
+ return;
+
+ }
+@@ -667,7 +668,7 @@
+ cidr2iplist(tcpr_cidr_t * cidr, char delim)
+ {
+ char *list = NULL;
+- char ipaddr[16];
++ char ipaddr[16], tempbuff[20];
+ u_int32_t size, addr, first, last, numips;
+ struct in_addr in;
+
+@@ -694,7 +695,8 @@
+ /* loop through all but the last one */
+ for (addr = first; addr < last; addr++) {
+ in.s_addr = htonl(addr);
+- snprintf(ipaddr, 17, "%s%c", inet_ntoa(in), delim);
++ snprintf(tempbuff, 17, "%s%c", inet_ntoa(in), delim);
++ memcpy(ipaddr, tempbuff, 16);
+ dbgx(2, "%s", ipaddr);
+ strlcat(list, ipaddr, size);
+ }
+
diff --git a/net-analyzer/tcpreplay/tcpreplay-3.4.4-r1.ebuild b/net-analyzer/tcpreplay/tcpreplay-3.4.4-r1.ebuild
new file mode 100644
index 000000000000..56545bc5f5be
--- /dev/null
+++ b/net-analyzer/tcpreplay/tcpreplay-3.4.4-r1.ebuild
@@ -0,0 +1,57 @@
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-analyzer/tcpreplay/tcpreplay-3.4.4-r1.ebuild,v 1.1 2010/10/29 13:41:07 pva Exp $
+
+EAPI="2"
+
+inherit eutils
+
+DESCRIPTION="replay saved tcpdump or snoop files at arbitrary speeds"
+HOMEPAGE="http://tcpreplay.synfin.net/"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~sparc ~x86"
+IUSE="debug pcapnav +tcpdump"
+
+DEPEND="
+ >=sys-devel/autogen-5.9.8
+ dev-libs/libdnet
+ >=net-libs/libpcap-0.9
+ tcpdump? ( net-analyzer/tcpdump )
+ pcapnav? ( net-libs/libpcapnav )"
+
+RDEPEND="${DEPEND}"
+
+src_prepare() {
+ echo "We don't use bundled libopts" > libopts/options.h
+ epatch ${FILESDIR}/${P}-crash.patch
+}
+
+src_configure() {
+ # By default it uses static linking. Avoid that, bug 252940
+ econf --enable-shared \
+ --disable-local-libopts \
+ $(use_with tcpdump tcpdump /usr/sbin/tcpdump) \
+ $(use_with pcapnav pcapnav-config /usr/bin/pcapnav-config) \
+ $(use_enable debug)
+}
+
+src_test() {
+ if [[ ! ${EUID} -eq 0 ]]; then
+ ewarn "Some tests were disabled due to FEATURES=userpriv"
+ ewarn "To run all tests issue the following command as root:"
+ ewarn " # make -C ${S}/test"
+ make -C test tcpprep || die "self test failed - see ${S}/test/test.log"
+ else
+ make test || {
+ ewarn "Note, that some tests require eth0 iface to be UP." ;
+ die "self test failed - see ${S}/test/test.log" ; }
+ fi
+}
+
+src_install() {
+ make DESTDIR="${D}" install || die
+ dodoc README docs/{CHANGELOG,CREDIT,HACKING,TODO} || die
+}