@@ -33,7 +33,7 @@ class LocalFileOpenCall extends Storable {
3333
3434 override Expr getAStore ( ) {
3535 exists ( FilesystemFlowConfig conf , DataFlow:: Node n |
36- filesystemStore ( n , result ) and
36+ closesFile ( n , result ) and
3737 conf .hasFlow ( DataFlow:: exprNode ( this ) , n )
3838 )
3939 }
@@ -57,14 +57,14 @@ private predicate isVarargs(Argument arg, DataFlow::ImplicitVarargsArray varargs
5757
5858/** Holds if `store` closes `file`. */
5959private 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 ( )
6464 or
6565 // 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 ( )
6868}
6969
7070/** A method that closes a file, perhaps after writing some data. */
@@ -87,7 +87,7 @@ private class FilesystemFlowConfig extends DataFlow::Configuration {
8787
8888 override predicate isSink ( DataFlow:: Node sink ) {
8989 filesystemInput ( sink , _) or
90- filesystemStore ( sink , _)
90+ closesFile ( sink , _)
9191 }
9292
9393 override predicate isAdditionalFlowStep ( DataFlow:: Node node1 , DataFlow:: Node node2 ) {
0 commit comments