mirror of
https://github.com/github/codeql.git
synced 2026-04-29 18:55:14 +02:00
Add files via upload
This commit is contained in:
@@ -0,0 +1 @@
|
||||
| test.cpp:11:20:11: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. |
|
||||
@@ -0,0 +1 @@
|
||||
experimental/Security/CWE/CWE-377/InsecureTemporaryFile.ql
|
||||
@@ -0,0 +1,16 @@
|
||||
typedef int FILE;
|
||||
#define NULL (0)
|
||||
FILE *fopen(char *filename, const char *mode);
|
||||
char * tmpnam(char * name);
|
||||
int fprintf(FILE *fp,const char *fmt, ...);
|
||||
int fclose(FILE *stream);
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
FILE *fp;
|
||||
char *filename = tmpnam(NULL); // BAD
|
||||
fp = fopen(filename,"w");
|
||||
fprintf(fp,"%s\n","data to file");
|
||||
fclose(fp);
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user