Skip to content

Commit 073189e

Browse files
committed
python: add test for re.Match objects returned from finditer
1 parent 6ffdf57 commit 073189e

File tree

1 file changed

+6
-0
lines changed
  • python/ql/test/library-tests/frameworks/stdlib

1 file changed

+6
-0
lines changed

python/ql/test/library-tests/frameworks/stdlib/test_re.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,12 @@
3838

3939
compiled_pat.match(ts).string, # $ tainted
4040
re.compile(ts).match("safe").re.pattern, # $ tainted
41+
42+
list(re.finditer(pat, ts))[0].string, # $ MISSING: tainted
43+
[m.string for m in re.finditer(pat, ts)], # $ MISSING: tainted
44+
45+
list(re.finditer(pat, ts))[0].groups()[0], # $ MISSING: tainted
46+
[m.groups()[0] for m in re.finditer(pat, ts)], # $ MISSING: tainted
4147
)
4248
ensure_not_tainted(
4349
safe_match.expand("Hello \1"),

0 commit comments

Comments
 (0)