File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed
python/ql/lib/semmle/python/frameworks Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change
1
+ /**
2
+ * Provides classes modeling security-relevant aspects of built-ins.
3
+ */
4
+
5
+ import python
6
+ private import semmle.python.dataflow.new.FlowSummary
7
+ private import semmle.python.ApiGraphs
8
+
9
+ /** A flow summary for `reversed`. */
10
+ class ReversedSummary extends SummarizedCallable {
11
+ ReversedSummary ( ) { this = "builtins.reversed" }
12
+
13
+ override CallNode getACall ( ) { result = API:: builtin ( "reversed" ) .getACall ( ) .getNode ( ) }
14
+
15
+ override DataFlow:: ArgumentNode getACallback ( ) {
16
+ result = API:: builtin ( "reversed" ) .getAValueReachableFromSource ( )
17
+ }
18
+
19
+ override predicate propagatesFlowExt ( string input , string output , boolean preservesValue ) {
20
+ input = "Argument[0].ListElement" and
21
+ output = "ReturnValue.ListElement" and
22
+ preservesValue = true
23
+ }
24
+ }
You can’t perform that action at this time.
0 commit comments