Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 8a1d271

Browse files
authored
Add files via upload
1 parent 1dacd2e commit 8a1d271

3 files changed

Lines changed: 19 additions & 0 deletions

File tree

Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
| test.cpp:12:8:12:12 | call to fopen | You may have forgotten to restrict access rights when working with a file. |
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
experimental/Security/CWE/CWE-200/ExposureSensitiveInformationUnauthorizedActor.ql
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
typedef int FILE;
2+
FILE *fopen(const char *filename, const char *mode);
3+
int umask(int pmode);
4+
int chmod(char * filename,int pmode);
5+
int fprintf(FILE *fp,const char *fmt, ...);
6+
int fclose(FILE *stream);
7+
8+
int main(int argc, char *argv[])
9+
{
10+
//umask(0022);
11+
FILE *fp;
12+
fp = fopen("myFile.txt","w"); // BAD
13+
//chmod("myFile.txt",0644);
14+
fprintf(fp,"%s\n","data to file");
15+
fclose(fp);
16+
return 0;
17+
}

0 commit comments

Comments
 (0)