We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 6a985a3 + c4fd39e commit a4c0a03Copy full SHA for a4c0a03
cpp/ql/src/Security/CWE/CWE-732/DoNotCreateWorldWritable.c
@@ -1,11 +1,11 @@
1
-int write_default_config_bad() {
+void write_default_config_bad() {
2
// BAD - this is world-writable so any user can overwrite the config
3
- FILE* out = creat(OUTFILE, 0666);
4
- fprintf(out, DEFAULT_CONFIG);
+ int out = creat(OUTFILE, 0666);
+ dprintf(out, DEFAULT_CONFIG);
5
}
6
7
-int write_default_config_good() {
+void write_default_config_good() {
8
// GOOD - this allows only the current user to modify the file
9
- FILE* out = creat(OUTFILE, S_IWUSR | S_IRUSR);
10
+ int out = creat(OUTFILE, S_IWUSR | S_IRUSR);
11
0 commit comments