Line 0
Link Here
|
|
|
1 |
--- fuzz.c.orig Mon May 12 01:49:39 2003 |
2 |
+++ fuzz.c Mon May 12 01:53:44 2003 |
3 |
@@ -387,10 +387,16 @@ |
4 |
int progpipe[2],status; |
5 |
char sendnewline=0; |
6 |
unsigned long curchar=0,linelen=0; |
7 |
+ int fd; |
8 |
|
9 |
// finish setting up files |
10 |
if(!execute_filename){ |
11 |
- snprintf(outfilename,MAXPATH,"/tmp%s.%lu",strrchr(progname,'/'),runs); |
12 |
+ snprintf(outfilename,MAXPATH,"/tmp%s.%lu.XXXXXX",strrchr(progname,'/'),runs); |
13 |
+ if ((fd=mkstemp(outfilename)) < 0) { |
14 |
+ perror("Unable to create temporary file"); |
15 |
+ abort(); |
16 |
+ } |
17 |
+ close(fd); |
18 |
if((outfile=fopen(outfilename,"w"))==NULL){ |
19 |
fprintf(stderr,"Can't fopen outfile.\n"); |
20 |
abort(); |