@@ -44,9 +44,9 @@ class ExecTaintConfiguration2 extends TaintTracking::Configuration {
44
44
override predicate isSource ( DataFlow:: Node source ) { source instanceof Source }
45
45
46
46
override predicate isSink ( DataFlow:: Node sink ) {
47
- exists ( RuntimeExecMethod method , MethodAccess call , int index |
47
+ exists ( RuntimeExecMethod method , MethodAccess call |
48
48
call .getMethod ( ) = method and
49
- sink .asExpr ( ) = call .getArgument ( index ) and
49
+ sink .asExpr ( ) = call .getArgument ( _ ) and
50
50
sink .asExpr ( ) .getType ( ) instanceof Array
51
51
)
52
52
}
@@ -62,36 +62,33 @@ class ExecTaintConfiguration2 extends TaintTracking::Configuration {
62
62
63
63
// array[3] = node
64
64
class AssignToNonZeroIndex extends DataFlow:: Node {
65
- AssignExpr assign ;
66
- ArrayAccess access ;
67
-
68
65
AssignToNonZeroIndex ( ) {
69
- assign .getDest ( ) = access and
70
- access .getIndexExpr ( ) .( IntegerLiteral ) .getValue ( ) != "0" and
71
- assign .getSource ( ) = this .asExpr ( )
66
+ exists ( AssignExpr assign , ArrayAccess access |
67
+ assign .getDest ( ) = access and
68
+ access .getIndexExpr ( ) .( IntegerLiteral ) .getValue ( ) != "0" and
69
+ assign .getSource ( ) = this .asExpr ( )
70
+ )
72
71
}
73
72
}
74
73
75
74
// String[] array = {"a", "b, "c"};
76
75
class ArrayInitAtNonZeroIndex extends DataFlow:: Node {
77
- ArrayInit init ;
78
- int index ;
79
-
80
76
ArrayInitAtNonZeroIndex ( ) {
81
- init .getInit ( index ) = this .asExpr ( ) and
82
- index != 0
77
+ exists ( ArrayInit init , int index |
78
+ init .getInit ( index ) = this .asExpr ( ) and
79
+ index != 0
80
+ )
83
81
}
84
82
}
85
83
86
84
// Stream.concat(Arrays.stream(array_1), Arrays.stream(array_2))
87
85
class StreamConcatAtNonZeroIndex extends DataFlow:: Node {
88
- MethodAccess call ;
89
- int index ;
90
-
91
86
StreamConcatAtNonZeroIndex ( ) {
92
- call .getMethod ( ) .getQualifiedName ( ) = "java.util.stream.Stream.concat" and
93
- call .getArgument ( index ) = this .asExpr ( ) and
94
- index != 0
87
+ exists ( MethodAccess call , int index |
88
+ call .getMethod ( ) .getQualifiedName ( ) = "java.util.stream.Stream.concat" and
89
+ call .getArgument ( index ) = this .asExpr ( ) and
90
+ index != 0
91
+ )
95
92
}
96
93
}
97
94
0 commit comments