mirror of
https://github.com/github/codeql.git
synced 2026-04-28 02:05:14 +02:00
python: add test for re.Match objects returned from finditer
This commit is contained in:
@@ -38,6 +38,12 @@ ensure_tainted(
|
||||
|
||||
compiled_pat.match(ts).string, # $ tainted
|
||||
re.compile(ts).match("safe").re.pattern, # $ tainted
|
||||
|
||||
list(re.finditer(pat, ts))[0].string, # $ MISSING: tainted
|
||||
[m.string for m in re.finditer(pat, ts)], # $ MISSING: tainted
|
||||
|
||||
list(re.finditer(pat, ts))[0].groups()[0], # $ MISSING: tainted
|
||||
[m.groups()[0] for m in re.finditer(pat, ts)], # $ MISSING: tainted
|
||||
)
|
||||
ensure_not_tainted(
|
||||
safe_match.expand("Hello \1"),
|
||||
|
||||
Reference in New Issue
Block a user