File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
python/ql/test/library-tests/frameworks/lxml Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change 11import lxml .etree as ET
22import io
3+ import typing
34
45def ensure_tainted (* args ):
56 print ("ensure_tainted: " , * args )
@@ -133,6 +134,21 @@ def func(tree_arg: ET.ElementTree):
133134 )
134135
135136 func (tree2 )
137+
138+ def func2 (x ):
139+ return x
140+
141+ def func3 (x ) -> ET .Element :
142+ return x
143+
144+ ensure_tainted (
145+ func2 (tree ), # $ tainted
146+ func2 (tree ).text , # $ MISSING:tainted - type tracking not tracked through flow preserving calls
147+ func3 (tree ).text , # $ MISSING:tainted - this includes if there is a type hint annotation on the return
148+ typing .cast (ET .ElementTree , tree ), # $ tainted
149+ typing .cast (ET .ElementTree , tree ).text , # $ MISSING:tainted - this includes for flow summary models
150+
151+ )
136152
137153
138154test ()
You can’t perform that action at this time.
0 commit comments