Skip to content

Commit

Permalink
python: add test for re.Match objects returned from finditer
Browse files Browse the repository at this point in the history
  • Loading branch information
yoff committed Oct 9, 2024
1 parent 6ffdf57 commit 073189e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions python/ql/test/library-tests/frameworks/stdlib/test_re.py
Original file line number Diff line number Diff line change
@@ -38,6 +38,12 @@

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"),

0 comments on commit 073189e

Please sign in to comment.