mirror of
https://github.com/github/codeql.git
synced 2025-12-21 19:26:31 +01:00
filter out potential misparses from java/suspicious-regexp-range
This commit is contained in:
@@ -13,6 +13,13 @@
|
||||
|
||||
import semmle.code.java.security.SuspiciousRegexpRangeQuery
|
||||
|
||||
RegExpCharacterClass potentialMisparsedCharClass() {
|
||||
// nested char classes are currently misparsed
|
||||
result.getAChild().(RegExpNormalChar).getValue() = "["
|
||||
}
|
||||
|
||||
from RegExpCharacterRange range, string reason
|
||||
where problem(range, reason)
|
||||
where
|
||||
problem(range, reason) and
|
||||
not range.getParent() = potentialMisparsedCharClass()
|
||||
select range, "Suspicious character range that " + reason + "."
|
||||
|
||||
Reference in New Issue
Block a user