Skip to content

Commit

Permalink
fix potential buffer overrun of a filename
Browse files Browse the repository at this point in the history
  • Loading branch information
teuben committed Feb 1, 2018
1 parent 15ea91a commit b1c95c9
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -4790,11 +4790,10 @@ int output2(char *output, int N, int NNBMAX, double RS0, double dtadj, double dt

int output3(char *output, int N, double rvir, double rh, double mmean, double M, double epoch, double Z, double *RG, double *VG, double rtide, double **star, double Rgal, double extmass, double extrad){
//Open output files
char tablefile[20];
char *tablefile = strcat(output,".txt");
FILE *TABLE;
sprintf(tablefile, "%s.txt",output);
TABLE = fopen(tablefile,"w");

TABLE = fopen(tablefile,"w");

//write to .txt file
int i, j;
Expand Down

0 comments on commit b1c95c9

Please sign in to comment.