@@ -30,30 +30,34 @@ DataFlow::Node shouldNotBeTainted() {
3030 )
3131}
3232
33- class TestTaintTrackingConfiguration extends TaintTracking:: Configuration {
34- TestTaintTrackingConfiguration ( ) { this = "TestTaintTrackingConfiguration" }
33+ module Conf {
34+ class TestTaintTrackingConfiguration extends TaintTracking:: Configuration {
35+ TestTaintTrackingConfiguration ( ) { this = "TestTaintTrackingConfiguration" }
3536
36- override predicate isSource ( DataFlow:: Node source ) {
37- source .asCfgNode ( ) .( NameNode ) .getId ( ) in [
38- "TAINTED_STRING" , "TAINTED_BYTES" , "TAINTED_LIST" , "TAINTED_DICT"
39- ]
40- or
41- // User defined sources
42- exists ( CallNode call |
43- call .getFunction ( ) .( NameNode ) .getId ( ) = "taint" and
44- source .( DataFlow:: CfgNode ) .getNode ( ) = call .getAnArg ( )
45- )
46- or
47- source instanceof RemoteFlowSource
48- }
37+ override predicate isSource ( DataFlow:: Node source ) {
38+ source .asCfgNode ( ) .( NameNode ) .getId ( ) in [
39+ "TAINTED_STRING" , "TAINTED_BYTES" , "TAINTED_LIST" , "TAINTED_DICT"
40+ ]
41+ or
42+ // User defined sources
43+ exists ( CallNode call |
44+ call .getFunction ( ) .( NameNode ) .getId ( ) = "taint" and
45+ source .( DataFlow:: CfgNode ) .getNode ( ) = call .getAnArg ( )
46+ )
47+ or
48+ source instanceof RemoteFlowSource
49+ }
4950
50- override predicate isSink ( DataFlow:: Node sink ) {
51- sink = shouldBeTainted ( )
52- or
53- sink = shouldNotBeTainted ( )
51+ override predicate isSink ( DataFlow:: Node sink ) {
52+ sink = shouldBeTainted ( )
53+ or
54+ sink = shouldNotBeTainted ( )
55+ }
5456 }
5557}
5658
59+ import Conf
60+
5761class InlineTaintTest extends InlineExpectationsTest {
5862 InlineTaintTest ( ) { this = "InlineTaintTest" }
5963
0 commit comments