File tree Expand file tree Collapse file tree
java/ql/test/library-tests/frameworks/ratpack Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3,28 +3,28 @@ import semmle.code.java.dataflow.TaintTracking
33import semmle.code.java.dataflow.FlowSources
44import TestUtilities.InlineExpectationsTest
55
6- class Conf extends TaintTracking:: Configuration {
7- Conf ( ) { this = "qltest:frameworks:ratpack" }
8-
9- override predicate isSource ( DataFlow:: Node n ) {
6+ module Config implements DataFlow:: ConfigSig {
7+ predicate isSource ( DataFlow:: Node n ) {
108 n .asExpr ( ) .( MethodAccess ) .getMethod ( ) .hasName ( "taint" )
119 or
1210 n instanceof RemoteFlowSource
1311 }
1412
15- override predicate isSink ( DataFlow:: Node n ) {
13+ predicate isSink ( DataFlow:: Node n ) {
1614 exists ( MethodAccess ma | ma .getMethod ( ) .hasName ( "sink" ) | n .asExpr ( ) = ma .getAnArgument ( ) )
1715 }
1816}
1917
18+ module Flow = TaintTracking:: Global< Config > ;
19+
2020class HasFlowTest extends InlineExpectationsTest {
2121 HasFlowTest ( ) { this = "HasFlowTest" }
2222
2323 override string getARelevantTag ( ) { result = "hasTaintFlow" }
2424
2525 override predicate hasActualResult ( Location location , string element , string tag , string value ) {
2626 tag = "hasTaintFlow" and
27- exists ( DataFlow:: Node sink , Conf conf | conf . hasFlowTo ( sink ) |
27+ exists ( DataFlow:: Node sink | Flow :: flowTo ( sink ) |
2828 sink .getLocation ( ) = location and
2929 element = sink .toString ( ) and
3030 value = ""
You can’t perform that action at this time.
0 commit comments