File tree 1 file changed +16
-0
lines changed
python/ql/test/library-tests/frameworks/lxml
1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change 1
1
import lxml .etree as ET
2
2
import io
3
+ import typing
3
4
4
5
def ensure_tainted (* args ):
5
6
print ("ensure_tainted: " , * args )
@@ -133,6 +134,21 @@ def func(tree_arg: ET.ElementTree):
133
134
)
134
135
135
136
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
+ )
136
152
137
153
138
154
test ()
You can’t perform that action at this time.
0 commit comments