File tree Expand file tree Collapse file tree 3 files changed +22
-38
lines changed
swift/ql/test/library-tests/dataflow/taint Expand file tree Collapse file tree 3 files changed +22
-38
lines changed Original file line number Diff line number Diff line change 33 */
44
55import swift
6- import codeql.swift.dataflow.TaintTracking
7- import codeql.swift.dataflow.DataFlow:: DataFlow
6+ import Taint
87import PathGraph
98
10- class TestConfiguration extends TaintTracking:: Configuration {
11- TestConfiguration ( ) { this = "TestConfiguration" }
12-
13- override predicate isSource ( Node src ) {
14- src .asExpr ( ) .( CallExpr ) .getStaticTarget ( ) .getName ( ) .matches ( "source%" )
15- }
16-
17- override predicate isSink ( Node sink ) {
18- exists ( CallExpr sinkCall |
19- sinkCall .getStaticTarget ( ) .getName ( ) .matches ( "sink%" ) and
20- sinkCall .getAnArgument ( ) .getExpr ( ) = sink .asExpr ( )
21- )
22- }
23-
24- override int explorationLimit ( ) { result = 100 }
25- }
26-
279from PathNode src , PathNode sink , TestConfiguration test
2810where test .hasFlowPath ( src , sink )
2911select sink , src , sink , "result"
Original file line number Diff line number Diff line change 1+ import swift
2+ import codeql.swift.dataflow.TaintTracking
3+ import codeql.swift.dataflow.DataFlow:: DataFlow
4+
5+ class TestConfiguration extends TaintTracking:: Configuration {
6+ TestConfiguration ( ) { this = "TestConfiguration" }
7+
8+ override predicate isSource ( Node src ) {
9+ src .asExpr ( ) .( CallExpr ) .getStaticTarget ( ) .getName ( ) .matches ( "source%" )
10+ }
11+
12+ override predicate isSink ( Node sink ) {
13+ exists ( CallExpr sinkCall |
14+ sinkCall .getStaticTarget ( ) .getName ( ) .matches ( "sink%" ) and
15+ sinkCall .getAnArgument ( ) .getExpr ( ) = sink .asExpr ( )
16+ )
17+ }
18+
19+ override int explorationLimit ( ) { result = 100 }
20+ }
Original file line number Diff line number Diff line change 11import swift
2- import codeql.swift.dataflow.TaintTracking
3- import codeql.swift.dataflow.DataFlow:: DataFlow
2+ import Taint
43import TestUtilities.InlineExpectationsTest
54
6- class TestConfiguration extends TaintTracking:: Configuration {
7- TestConfiguration ( ) { this = "TestConfiguration" }
8-
9- override predicate isSource ( Node src ) {
10- src .asExpr ( ) .( CallExpr ) .getStaticTarget ( ) .getName ( ) .matches ( "source%" )
11- }
12-
13- override predicate isSink ( Node sink ) {
14- exists ( CallExpr sinkCall |
15- sinkCall .getStaticTarget ( ) .getName ( ) .matches ( "sink%" ) and
16- sinkCall .getAnArgument ( ) .getExpr ( ) = sink .asExpr ( )
17- )
18- }
19-
20- override int explorationLimit ( ) { result = 100 }
21- }
22-
235class TaintTest extends InlineExpectationsTest {
246 TaintTest ( ) { this = "TaintTest" }
257
You can’t perform that action at this time.
0 commit comments