mirror of
https://github.com/github/codeql.git
synced 2026-04-28 02:05:14 +02:00
C++: Fix chmod prototype in toctou test and additional test
This commit is contained in:
@@ -19,7 +19,7 @@ bool stat(const char *path, stat_data *buf);
|
||||
bool fstat(int file, stat_data *buf);
|
||||
bool lstat(const char *path, stat_data *buf);
|
||||
bool fstatat(int dir, const char *path, stat_data *buf);
|
||||
void chmod(const char *path, int setting);
|
||||
int chmod(const char *path, int setting);
|
||||
int rename(const char *from, const char *to);
|
||||
bool remove(const char *path);
|
||||
|
||||
@@ -408,3 +408,8 @@ void test7_1(const char *path1, const char *path2)
|
||||
chmod(path2, 1234); // BAD
|
||||
}
|
||||
}
|
||||
|
||||
int test8(const char *path, int mode)
|
||||
{
|
||||
return (chmod(path, mode) == 0 ? 1 : 0);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user