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 570538b + 7f1bd49 commit 6dd941eCopy full SHA for 6dd941e
cpp/ql/test/query-tests/Security/CWE/CWE-367/semmle/test2.cpp
@@ -19,7 +19,7 @@ bool stat(const char *path, stat_data *buf);
19
bool fstat(int file, stat_data *buf);
20
bool lstat(const char *path, stat_data *buf);
21
bool fstatat(int dir, const char *path, stat_data *buf);
22
-void chmod(const char *path, int setting);
+int chmod(const char *path, int setting);
23
int rename(const char *from, const char *to);
24
bool remove(const char *path);
25
@@ -408,3 +408,8 @@ void test7_1(const char *path1, const char *path2)
408
chmod(path2, 1234); // BAD
409
}
410
411
+
412
+int test8(const char *path, int mode)
413
+{
414
+ return (chmod(path, mode) == 0 ? 1 : 0); // GOOD
415
+}
0 commit comments