Apply suggestions from code review

Co-authored-by: Geoffrey White <40627776+geoffw0@users.noreply.github.com>
This commit is contained in:
ihsinme
2022-03-01 12:25:57 +03:00
committed by GitHub
parent c916bed853
commit be11e4fc2d
2 changed files with 2 additions and 2 deletions

View File

@@ -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

View File

@@ -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);