@@ -33,7 +33,7 @@ class LocalFileOpenCall extends Storable {
33
33
34
34
override Expr getAStore ( ) {
35
35
exists ( FilesystemFlowConfig conf , DataFlow:: Node n |
36
- filesystemStore ( n , result ) and
36
+ closesFile ( n , result ) and
37
37
conf .hasFlow ( DataFlow:: exprNode ( this ) , n )
38
38
)
39
39
}
@@ -57,14 +57,14 @@ private predicate isVarargs(Argument arg, DataFlow::ImplicitVarargsArray varargs
57
57
58
58
/** Holds if `store` closes `file`. */
59
59
private predicate closesFile ( DataFlow:: Node file , Call closeCall ) {
60
- store .getCallee ( ) instanceof CloseFileMethod and
61
- if store .getCallee ( ) .isStatic ( )
62
- then file .asExpr ( ) = store
63
- else file .asExpr ( ) = store .getQualifier ( )
60
+ closeCall .getCallee ( ) instanceof CloseFileMethod and
61
+ if closeCall .getCallee ( ) .isStatic ( )
62
+ then file .asExpr ( ) = closeCall
63
+ else file .asExpr ( ) = closeCall .getQualifier ( )
64
64
or
65
65
// try-with-resources automatically closes the file
66
- any ( TryStmt try ) .getAResource ( ) = store .( LocalFileOpenCall ) .getEnclosingStmt ( ) and
67
- store = file .asExpr ( )
66
+ any ( TryStmt try ) .getAResource ( ) = closeCall .( LocalFileOpenCall ) .getEnclosingStmt ( ) and
67
+ closeCall = file .asExpr ( )
68
68
}
69
69
70
70
/** A method that closes a file, perhaps after writing some data. */
@@ -87,7 +87,7 @@ private class FilesystemFlowConfig extends DataFlow::Configuration {
87
87
88
88
override predicate isSink ( DataFlow:: Node sink ) {
89
89
filesystemInput ( sink , _) or
90
- filesystemStore ( sink , _)
90
+ closesFile ( sink , _)
91
91
}
92
92
93
93
override predicate isAdditionalFlowStep ( DataFlow:: Node node1 , DataFlow:: Node node2 ) {
0 commit comments