diff options
author | Jeroen Roovers <jer@gentoo.org> | 2010-12-01 00:38:44 +0000 |
---|---|---|
committer | Jeroen Roovers <jer@gentoo.org> | 2010-12-01 00:38:44 +0000 |
commit | 36defb1b30ad345f3dede6931314b472b39468f1 (patch) | |
tree | 607993c4ec5f43251931b9e4c4f1c622c7eceea0 /net-analyzer | |
parent | arm stable (bug 305781) (diff) | |
download | gentoo-2-36defb1b30ad345f3dede6931314b472b39468f1.tar.gz gentoo-2-36defb1b30ad345f3dede6931314b472b39468f1.tar.bz2 gentoo-2-36defb1b30ad345f3dede6931314b472b39468f1.zip |
Fix buffer overflow, compiler warnings (bug #337422).
(Portage version: 2.2.0_alpha6/cvs/Linux i686)
Diffstat (limited to 'net-analyzer')
-rw-r--r-- | net-analyzer/netperf/ChangeLog | 8 | ||||
-rw-r--r-- | net-analyzer/netperf/files/netperf-2.4.5-netserver.patch | 50 | ||||
-rw-r--r-- | net-analyzer/netperf/netperf-2.4.5-r1.ebuild (renamed from net-analyzer/netperf/netperf-2.4.5.ebuild) | 12 |
3 files changed, 66 insertions, 4 deletions
diff --git a/net-analyzer/netperf/ChangeLog b/net-analyzer/netperf/ChangeLog index a5ae9f44ec00..149937baf6d2 100644 --- a/net-analyzer/netperf/ChangeLog +++ b/net-analyzer/netperf/ChangeLog @@ -1,6 +1,12 @@ # ChangeLog for net-analyzer/netperf # Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/net-analyzer/netperf/ChangeLog,v 1.45 2010/06/28 15:32:49 gmsoft Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-analyzer/netperf/ChangeLog,v 1.46 2010/12/01 00:38:44 jer Exp $ + +*netperf-2.4.5-r1 (01 Dec 2010) + + 01 Dec 2010; Jeroen Roovers <jer@gentoo.org> -netperf-2.4.5.ebuild, + +netperf-2.4.5-r1.ebuild, +files/netperf-2.4.5-netserver.patch: + Fix buffer overflow, compiler warnings (bug #337422). 28 Jun 2010; Guy Martin <gmsoft@gentoo.org> netperf-2.4.4.ebuild: hppa stable. diff --git a/net-analyzer/netperf/files/netperf-2.4.5-netserver.patch b/net-analyzer/netperf/files/netperf-2.4.5-netserver.patch new file mode 100644 index 000000000000..362e4aeb2107 --- /dev/null +++ b/net-analyzer/netperf/files/netperf-2.4.5-netserver.patch @@ -0,0 +1,50 @@ +# Set DEBUG_LOG_FILE location +# Fix compiler warnings (bug #337422): + netserver.c: In function ‘process_requests’: + netserver.c:287: warning: array subscript is above array bounds + inlined from ‘process_requests’ at netserver.c:268: + /usr/include/bits/stdio2.h:65: warning: call to __builtin___snprintf_chk will always overflow destination buffer + inlined from ‘process_requests’ at netserver.c:284: + /usr/include/bits/stdio2.h:65: warning: call to __builtin___snprintf_chk will always overflow destination buffer + +--- a/src/netserver.c ++++ b/src/netserver.c +@@ -142,7 +142,7 @@ + + #ifndef DEBUG_LOG_FILE + #ifndef WIN32 +-#define DEBUG_LOG_FILE "/tmp/netperf.debug" ++#define DEBUG_LOG_FILE "/var/log/netperf.debug" + #else + #define DEBUG_LOG_FILE "c:\\temp\\netperf.debug" + #endif /* WIN32 */ +@@ -266,7 +266,7 @@ + (!strstr(local_machine,delims[i])) && + (!strstr(local_version,delims[i]))) { + snprintf((char *)netperf_response.content.test_specific_data, +- sizeof(netperf_response) - 7, ++ MAXSPECDATA, + "%c%s%c%s%c%s%c%s", + delims[i][0], + local_sysname, +@@ -282,15 +282,15 @@ + if (i == 4) { + /* none of the delimiters were unique, use the last one */ + snprintf((char *)netperf_response.content.test_specific_data, +- sizeof(netperf_response) - 7, ++ MAXSPECDATA, + "%c%s%c%s%c%s%c%s", +- delims[i][0], ++ delims[3][0], + "NoDelimUnique", +- delims[i][0], ++ delims[3][0], + "NoDelimUnique", +- delims[i][0], ++ delims[3][0], + "NoDelimUnique", +- delims[i][0], ++ delims[3][0], + "NoDelimUnique"); + } + send_response_n(0); diff --git a/net-analyzer/netperf/netperf-2.4.5.ebuild b/net-analyzer/netperf/netperf-2.4.5-r1.ebuild index b4b13080ab3e..d75caad1da53 100644 --- a/net-analyzer/netperf/netperf-2.4.5.ebuild +++ b/net-analyzer/netperf/netperf-2.4.5-r1.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2010 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/net-analyzer/netperf/netperf-2.4.5.ebuild,v 1.2 2010/06/24 16:00:42 jer Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-analyzer/netperf/netperf-2.4.5-r1.ebuild,v 1.1 2010/12/01 00:38:44 jer Exp $ EAPI="2" @@ -19,8 +19,14 @@ DEPEND=">=sys-apps/sed-4" RDEPEND="!sci-mathematics/snns" src_prepare() { - sed -i 's:^\(#define DEBUG_LOG_FILE "\)/tmp/netperf.debug:\1/var/log/netperf.debug:' src/netserver.c - epatch "${FILESDIR}"/${PN}-fix-scripts.patch +cp -av src/netserver.c{,.orig} +# sed -i src/netserver.c \ +# -e '/^#define DEBUG_LOG_FILE/s:/tmp/:/var/log/:' \ +# -e 's:sizeof(netperf_response) - 7:MAXSPECDATA:g' + + epatch \ + "${FILESDIR}"/${PN}-fix-scripts.patch \ + "${FILESDIR}"/${P}-netserver.patch # Fixing paths in scripts sed -i -e 's:^\(NETHOME=\).*:\1"/usr/bin":' \ |