mirror of
https://github.com/github/codeql.git
synced 2026-04-29 02:35:15 +02:00
Apply suggestions from code review
Co-authored-by: Geoffrey White <40627776+geoffw0@users.noreply.github.com>
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @name Find work with the file without setting permissions.
|
||||
* @name Writing to a file without setting permissions.
|
||||
* @description Lack of restriction on file access rights can be unsafe.
|
||||
* @kind problem
|
||||
* @id cpp/work-with-file-without-permissions-rights
|
||||
|
||||
@@ -10,7 +10,7 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
FILE *fp;
|
||||
char buf[128];
|
||||
fp = fopen("myFile.txt","w"); // BAD [NOT DETECTED]
|
||||
fp = fopen("myFile.txt","r+"); // BAD [NOT DETECTED]
|
||||
fgets(buf,128,fp);
|
||||
fprintf(fp,"%s\n","data to file");
|
||||
fclose(fp);
|
||||
|
||||
Reference in New Issue
Block a user