summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHeiko Zuerker <smiley73@users.sourceforge.net>2010-12-26 11:31:15 -0600
committerPeter Korsgaard <jacmet@sunsite.dk>2010-12-27 23:30:46 +0100
commitee3c9d4759e2e7e70bc3f91648ad4680293af3cb (patch)
tree72288d5f0a83897fc4ceac2c76ac82b184e95c9d
parent1b4e24e80d8587b28b91e648d066525aa95075fc (diff)
netperf: add Gentoo patch to fix buffer overflow compiler warnings
Signed-off-by: Heiko Zuerker <smiley73@users.sourceforge.net> Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
-rw-r--r--package/netperf/netperf-2.4.5-netserver.patch51
1 files changed, 51 insertions, 0 deletions
diff --git a/package/netperf/netperf-2.4.5-netserver.patch b/package/netperf/netperf-2.4.5-netserver.patch
new file mode 100644
index 000000000..d841c1c70
--- /dev/null
+++ b/package/netperf/netperf-2.4.5-netserver.patch
@@ -0,0 +1,51 @@
+http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/net-analyzer/netperf/files/netperf-2.4.5-netserver.patch?view=log
+# 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);