mirror of
https://github.com/github/codeql.git
synced 2026-02-19 08:23:45 +01:00
account for more patterns in IntegerLiteral.getValue
This commit is contained in:
@@ -51,15 +51,23 @@ class IntegerLiteral extends NumericLiteral, TIntegerLiteral {
|
||||
exists(string s, string values, string str |
|
||||
s = this.getValueText() and
|
||||
(
|
||||
s.matches("0b%") and values = "01" and str = s.suffix(2)
|
||||
(s.matches("0b%") or s.matches("0B%")) and
|
||||
values = "01" and
|
||||
str = s.suffix(2)
|
||||
or
|
||||
s.matches("0x%") and values = "0123456789abcdef" and str = s.suffix(2)
|
||||
(s.matches("0x%") or s.matches("0X%")) and
|
||||
values = "0123456789abcdef" and
|
||||
str = s.suffix(2)
|
||||
or
|
||||
s.charAt(0) = "0" and
|
||||
not s.charAt(1) = ["b", "x"] and
|
||||
not s.charAt(1) = ["b", "B", "x", "X"] and
|
||||
values = "01234567" and
|
||||
str = s.suffix(1)
|
||||
or
|
||||
(s.matches("0o%") or s.matches("0O%")) and
|
||||
values = "01234567" and
|
||||
str = s.suffix(2)
|
||||
or
|
||||
s.charAt(0) != "0" and values = "0123456789" and str = s
|
||||
)
|
||||
|
|
||||
|
||||
Reference in New Issue
Block a user