mirror of
https://github.com/github/codeql.git
synced 2026-04-30 19:26:02 +02:00
Ensure that O_CREAT and O_TMPFILE are unique
This commit is contained in:
@@ -15,15 +15,21 @@ int parseHex(string input) {
|
||||
}
|
||||
|
||||
int o_creat() {
|
||||
exists(Macro m | m.getName() = "O_CREAT" |
|
||||
result = parseHex(m.getBody()) or result = UnixConstants::parseOctal(m.getBody())
|
||||
)
|
||||
result =
|
||||
unique(int v |
|
||||
exists(Macro m | m.getName() = "O_CREAT" |
|
||||
v = parseHex(m.getBody()) or v = UnixConstants::parseOctal(m.getBody())
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
int o_tmpfile() {
|
||||
exists(Macro m | m.getName() = "O_TMPFILE" |
|
||||
result = parseHex(m.getBody()) or result = UnixConstants::parseOctal(m.getBody())
|
||||
)
|
||||
result =
|
||||
unique(int v |
|
||||
exists(Macro m | m.getName() = "O_TMPFILE" |
|
||||
v = parseHex(m.getBody()) or v = UnixConstants::parseOctal(m.getBody())
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
bindingset[n, digit]
|
||||
|
||||
Reference in New Issue
Block a user