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

Skip to content

Commit be11e4f

Browse files
ihsinmegeoffw0
andauthored
Apply suggestions from code review
Co-authored-by: Geoffrey White <[email protected]>
1 parent c916bed commit be11e4f

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

cpp/ql/src/experimental/Security/CWE/CWE-200/ExposureSensitiveInformationUnauthorizedActor.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* @name Find work with the file without setting permissions.
2+
* @name Writing to a file without setting permissions.
33
* @description Lack of restriction on file access rights can be unsafe.
44
* @kind problem
55
* @id cpp/work-with-file-without-permissions-rights

cpp/ql/test/experimental/query-tests/Security/CWE/CWE-200/semmle/tests/test2.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ int main(int argc, char *argv[])
1010
{
1111
FILE *fp;
1212
char buf[128];
13-
fp = fopen("myFile.txt","w"); // BAD [NOT DETECTED]
13+
fp = fopen("myFile.txt","r+"); // BAD [NOT DETECTED]
1414
fgets(buf,128,fp);
1515
fprintf(fp,"%s\n","data to file");
1616
fclose(fp);

0 commit comments

Comments
 (0)