@@ -14,29 +14,21 @@ module Summaries {
14
14
private module Config implements DataFlow:: ConfigSig {
15
15
predicate isSource ( DataFlow:: Node source ) {
16
16
exists ( DataFlow:: MethodNode methodNode | methodNode .isPublic ( ) |
17
- getAnyParameterNode ( methodNode ) . asSource ( ) = source
17
+ Util :: getAnyParameter ( methodNode ) = source
18
18
)
19
19
}
20
20
21
21
predicate isSink ( DataFlow:: Node sink ) { sink = any ( DataFlow:: MethodNode m ) .getAReturnNode ( ) }
22
22
}
23
23
24
- private API:: Node getAnyParameterNode ( DataFlow:: MethodNode methodNode ) {
25
- result .asSource ( ) =
26
- [
27
- methodNode .getParameter ( _) , methodNode .getKeywordParameter ( _) ,
28
- methodNode .getBlockParameter ( ) , methodNode .getSelfParameter ( )
29
- ]
30
- }
31
-
32
24
private module ValueFlow {
33
25
import DataFlow:: Global< Config >
34
26
35
27
predicate summaryModel ( string type , string path , string input , string output ) {
36
28
exists ( DataFlow:: MethodNode methodNode , API:: Node paramNode |
37
29
methodNode .getLocation ( ) .getFile ( ) instanceof Util:: RelevantFile and
38
30
flow ( paramNode .asSource ( ) , methodNode .getAReturnNode ( ) ) and
39
- paramNode = getAnyParameterNode ( methodNode )
31
+ paramNode . asSource ( ) = Util :: getAnyParameter ( methodNode )
40
32
|
41
33
Util:: pathToMethod ( methodNode , type , path ) and
42
34
input = Util:: getArgumentPath ( paramNode .asSource ( ) ) and
@@ -53,7 +45,7 @@ module Summaries {
53
45
exists ( DataFlow:: MethodNode methodNode , API:: Node paramNode |
54
46
methodNode .getLocation ( ) .getFile ( ) instanceof Util:: RelevantFile and
55
47
flow ( paramNode .asSource ( ) , methodNode .getAReturnNode ( ) ) and
56
- paramNode = getAnyParameterNode ( methodNode )
48
+ paramNode . asSource ( ) = Util :: getAnyParameter ( methodNode )
57
49
|
58
50
Util:: pathToMethod ( methodNode , type , path ) and
59
51
input = Util:: getArgumentPath ( paramNode .asSource ( ) ) and
0 commit comments