Merge pull request #8424 from ihsinme/ihsinme-patch-fix077

Detection reduction on request
This commit is contained in:
Mathias Vorreiter Pedersen
2022-03-15 16:17:47 +00:00
committed by GitHub
3 changed files with 1 additions and 76 deletions

View File

@@ -1,2 +1 @@
| test.cpp:16:20:16:25 | call to tmpnam | Finding the name of a file that does not exist does not mean that it will not be exist at the next operation. |
| test.cpp:42:8:42:12 | call to fopen | Creating a file for writing without evaluating its existence and setting permissions can be unsafe. |

View File

@@ -39,7 +39,7 @@ int funcTest3()
FILE *fp;
char filename[80];
strcat(filename, "/tmp/tmp.name");
fp = fopen(filename,"w"); // BAD
fp = fopen(filename,"w"); // BAD [NOT DETECTED]
fprintf(fp,"%s\n","data to file");
fclose(fp);
return 0;