iperf: activate format-security checks
[openwrt/openwrt.git] / package / network / utils / iperf / patches / 002-format-security.patch
1 Description: iperf format string FTBFS with -Werror=format-security
2 Reported by Didier Raboud <odyx@debian.org>
3 Author: Simon Paillard <spaillard@debian.org>
4 Bug-Debian: http://bugs.debian.org/643408
5
6 --- a/compat/Thread.c
7 +++ b/compat/Thread.c
8 @@ -381,7 +381,7 @@ int thread_release_nonterm( int interrup
9 Condition_Lock( thread_sNum_cond );
10 thread_sNum -= nonterminating_num;
11 if ( thread_sNum > 1 && nonterminating_num > 0 && interrupt != 0 ) {
12 - fprintf( stderr, wait_server_threads );
13 + fprintf( stderr, "%s", wait_server_threads );
14 }
15 nonterminating_num = 0;
16 Condition_Signal( &thread_sNum_cond );
17 --- a/src/ReportDefault.c
18 +++ b/src/ReportDefault.c
19 @@ -78,7 +78,7 @@ void reporter_printstats( Transfer_Info
20 if ( stats->mUDP != (char)kMode_Server ) {
21 // TCP Reporting
22 if( !header_printed ) {
23 - printf( report_bw_header);
24 + printf( "%s", report_bw_header);
25 header_printed = 1;
26 }
27 printf( report_bw_format, stats->transferID,
28 @@ -87,7 +87,7 @@ void reporter_printstats( Transfer_Info
29 } else {
30 // UDP Reporting
31 if( !header_printed ) {
32 - printf( report_bw_jitter_loss_header);
33 + printf( "%s", report_bw_jitter_loss_header);
34 header_printed = 1;
35 }
36 printf( report_bw_jitter_loss_format, stats->transferID,
37 @@ -159,7 +159,7 @@ void reporter_reportsettings( ReporterDa
38 (data->mThreadMode == kMode_Listener ? 0 : 1) );
39 win_requested = data->mTCPWin;
40
41 - printf( separator_line );
42 + printf( "%s", separator_line );
43 if ( data->mThreadMode == kMode_Listener ) {
44 printf( server_port,
45 (isUDP( data ) ? "UDP" : "TCP"),
46 @@ -198,7 +198,7 @@ void reporter_reportsettings( ReporterDa
47 printf( warn_window_requested, buffer );
48 }
49 printf( "\n" );
50 - printf( separator_line );
51 + printf( "%s", separator_line );
52 }
53
54 /*
55 @@ -286,7 +286,7 @@ void reporter_reportMSS( int inMSS, thre
56 } else if ( checkMSS_MTU( inMSS, 576 ) ) {
57 net = "minimum";
58 mtu = 576;
59 - printf( warn_no_pathmtu );
60 + printf( "%s", warn_no_pathmtu );
61 } else {
62 mtu = inMSS + 40;
63 net = "unknown interface";
64 --- a/src/Reporter.c
65 +++ b/src/Reporter.c
66 @@ -901,7 +901,7 @@ void PrintMSS( ReporterData *stats ) {
67 } else if ( checkMSS_MTU( inMSS, 576 ) ) {
68 net = "minimum";
69 mtu = 576;
70 - printf( warn_no_pathmtu );
71 + printf( "%s", warn_no_pathmtu );
72 } else {
73 mtu = inMSS + 40;
74 net = "unknown interface";
75 --- a/src/Settings.cpp
76 +++ b/src/Settings.cpp
77 @@ -375,8 +375,8 @@ void Settings_Interpret( char option, co
78 break;
79
80 case 'h': // print help and exit
81 - fprintf(stderr, usage_long1);
82 - fprintf(stderr, usage_long2);
83 + fprintf(stderr, "%s", usage_long1);
84 + fprintf(stderr, "%s", usage_long2);
85 exit(1);
86 break;
87
88 @@ -482,7 +482,7 @@ void Settings_Interpret( char option, co
89 break;
90
91 case 'v': // print version and exit
92 - fprintf( stderr, version );
93 + fprintf( stderr, "%s", version );
94 exit(1);
95 break;
96