mirror of
https://github.com/github/codeql.git
synced 2026-05-01 03:35:13 +02:00
Use matches to check for 0x prefix
This commit is contained in:
@@ -3,7 +3,7 @@ import semmle.code.cpp.commons.unix.Constants
|
||||
|
||||
bindingset[input]
|
||||
int parseHex(string input) {
|
||||
input.prefix(2) = "0x" and
|
||||
input.matches("0x%") and
|
||||
result =
|
||||
strictsum(int ix |
|
||||
ix in [2 .. input.length()]
|
||||
|
||||
Reference in New Issue
Block a user