We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5d1c784 commit c6d8abcCopy full SHA for c6d8abc
1 file changed
cpp/ql/test/query-tests/Security/CWE/CWE-367/semmle/test2.cpp
@@ -331,3 +331,28 @@ void test6_5(const char *path1, const char *path2)
331
// ...
332
}
333
334
+
335
+// --- open / rename -> chmod ---
336
337
+void test7_1(const char *path)
338
+{
339
+ FILE *f;
340
341
+ f = fopen(path, "wt");
342
+ if (f != 0)
343
+ {
344
+ // ...
345
346
+ fclose(f);
347
348
+ chmod(path, 1234); // BAD [NOT DETECTED]
349
+ }
350
+}
351
352
+void test7_1(const char *path1, const char *path2)
353
354
+ if (!rename(path1, path2))
355
356
+ chmod(path2, 1234); // BAD [NOT DETECTED]
357
358
0 commit comments