File: 25-format-security.patch

package info (click to toggle)
pvm 3.4.6-5
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 8,284 kB
  • sloc: ansic: 72,074; makefile: 1,198; fortran: 631; sh: 285; csh: 74; asm: 37
file content (99 lines) | stat: -rw-r--r-- 1,976 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
--- a/console/cmds.c
+++ b/console/cmds.c
@@ -551,7 +551,7 @@
 			*nextcmd++ = '\0';
 
 			if ( !first )
-				printf( prompt );
+				fputs(prompt, stdout);
 			
 			else
 				first = 0;
--- a/console/cons.c
+++ b/console/cons.c
@@ -448,7 +448,7 @@
 			(CPPFunction *) command_completion;
 	rl_callback_handler_install( prompt, rl_got_line );
 #else
-	printf(prompt);
+	fputs(prompt, stdout);
 	fflush(stdout);
 #endif
 
@@ -516,7 +516,7 @@
 			}
 			cmd[n] = 0;
 			docmd(cmd);
-			printf(prompt);
+			fputs(prompt, stdout);
 			fflush(stdout);
 #endif
 
--- a/hoster/pvmwinrsh.c
+++ b/hoster/pvmwinrsh.c
@@ -267,7 +267,7 @@
 	stderrFlag=1; // mark connection made
 
 	while(receivesocket(rshServer, buff, 2047,"")>0) 
-		fprintf(stderr, buff);
+		fputs(buff, stderr);
     
         shutdown(rshClientErr, 2);
         closesocket(rshClientErr);
--- a/src/OS2/src/stdlog.c
+++ b/src/OS2/src/stdlog.c
@@ -10,7 +10,7 @@
    vsprintf(buf, fmt, argptr);
    va_end(argptr);
    F=fopen("c:/tmp/log.pvm","at");
-   if(F){ fprintf(F,buf);
+   if(F){ fputs(buf,F);
           fclose(F);
         }
 }
--- a/tracer/tracer.c
+++ b/tracer/tracer.c
@@ -170,7 +170,7 @@
 
 	prompt = "tracer> ";
 
-	printf( prompt );
+	fputs(prompt, stdout);
 	fflush( stdout );
 
 	/* Process Events Messages and User Input */
@@ -226,7 +226,7 @@
 
 				handle_cmd( cmd );
 
-				printf( prompt );
+				fputs(prompt, stdout);
 				fflush( stdout );
 			}
 		}
--- a/tracer/trclib.h
+++ b/tracer/trclib.h
@@ -101,7 +101,7 @@
 { \
 	if ( _c == (char) EOF ) \
 	{ \
-		printf( _str ); \
+		fputs(_str, stdout); \
 \
 		_handle; \
 	} \
--- a/tracer/trcutil.c
+++ b/tracer/trcutil.c
@@ -440,8 +440,12 @@
 
 				b = TEV_MASK_CHECK( tmask, x );
 
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wformat-security"
+				// fmt is valid as constructed above
 				printf( fmt, (b ? '*' : ' '), pvmtevinfo[x].name,
 					(c == ncols - 1 ? '\n' : ' ') );
+#pragma GCC diagnostic pop
 			}
 
 			else