File tree Expand file tree Collapse file tree
library-tests/frameworks/JaxWs Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -7,24 +7,28 @@ class DefaultValueFlowConf extends DataFlow::Configuration {
77 DefaultValueFlowConf ( ) { this = "qltest:defaultValueFlowConf" }
88
99 override predicate isSource ( DataFlow:: Node n ) {
10- n .asExpr ( ) .( MethodAccess ) .getMethod ( ) .hasName ( "source" )
10+ n .asExpr ( ) .( MethodAccess ) .getMethod ( ) .getName ( ) = [ "source" , "taint" ]
1111 }
1212
1313 override predicate isSink ( DataFlow:: Node n ) {
1414 exists ( MethodAccess ma | ma .getMethod ( ) .hasName ( "sink" ) | n .asExpr ( ) = ma .getAnArgument ( ) )
1515 }
16+
17+ override int fieldFlowBranchLimit ( ) { result = 1000 }
1618}
1719
1820class DefaultTaintFlowConf extends TaintTracking:: Configuration {
1921 DefaultTaintFlowConf ( ) { this = "qltest:defaultTaintFlowConf" }
2022
2123 override predicate isSource ( DataFlow:: Node n ) {
22- n .asExpr ( ) .( MethodAccess ) .getMethod ( ) .hasName ( "source" )
24+ n .asExpr ( ) .( MethodAccess ) .getMethod ( ) .getName ( ) = [ "source" , "taint" ]
2325 }
2426
2527 override predicate isSink ( DataFlow:: Node n ) {
26- n . asExpr ( ) . ( Argument ) . getCall ( ) . getCallee ( ) . hasName ( "sink" )
28+ exists ( MethodAccess ma | ma . getMethod ( ) . hasName ( "sink" ) | n . asExpr ( ) = ma . getAnArgument ( ) )
2729 }
30+
31+ override int fieldFlowBranchLimit ( ) { result = 1000 }
2832}
2933
3034class InlineFlowTest extends InlineExpectationsTest {
Original file line number Diff line number Diff line change 11import java
2- import semmle.code.java.dataflow.TaintTracking
32import TestUtilities.InlineFlowTest
43
5- class TaintFlowConf extends TaintTracking:: Configuration {
6- TaintFlowConf ( ) { this = "qltest:frameworks:jax-rs-taint" }
7-
8- override predicate isSource ( DataFlow:: Node n ) {
9- n .asExpr ( ) .( MethodAccess ) .getMethod ( ) .hasName ( "taint" )
10- }
11-
12- override predicate isSink ( DataFlow:: Node n ) {
13- exists ( MethodAccess ma | ma .getMethod ( ) .hasName ( "sink" ) | n .asExpr ( ) = ma .getAnArgument ( ) )
14- }
15-
16- override int fieldFlowBranchLimit ( ) { result = 1000 }
17- }
18-
19- class ValueFlowConf extends DataFlow:: Configuration {
20- ValueFlowConf ( ) { this = "qltest:frameworks:jax-rs-value" }
21-
22- override predicate isSource ( DataFlow:: Node n ) {
23- n .asExpr ( ) .( MethodAccess ) .getMethod ( ) .hasName ( "taint" )
24- }
25-
26- override predicate isSink ( DataFlow:: Node n ) {
27- exists ( MethodAccess ma | ma .getMethod ( ) .hasName ( "sink" ) | n .asExpr ( ) = ma .getAnArgument ( ) )
28- }
29-
30- // TODO: move to default?
31- override int fieldFlowBranchLimit ( ) { result = 1000 }
32- }
33-
34- class HasFlowTest extends InlineFlowTest {
35- override DataFlow:: Configuration getValueFlowConfig ( ) { result = any ( ValueFlowConf config ) }
36-
37- override DataFlow:: Configuration getTaintFlowConfig ( ) { result = any ( TaintFlowConf config ) }
38- }
4+ class HasFlowTest extends InlineFlowTest { }
You can’t perform that action at this time.
0 commit comments