Apply suggestions from code review

Co-authored-by: Chris Smowton <smowton@github.com>
This commit is contained in:
Tony Torralba
2022-01-17 10:46:21 +01:00
parent 22aad17d0e
commit d9e6e5aa04

View File

@@ -18,7 +18,7 @@ private class AndroidFilesystemCleartextStorageSink extends CleartextStorageSink
}
}
/** The creation of an object that can be used to write to files to the local filesystem. */
/** A call to a method or constructor that may write to files to the local filesystem. */
class LocalFileOpenCall extends Storable {
LocalFileOpenCall() {
this = any(DataFlow::Node sink | sinkNode(sink, "create-file")).asExpr().(Argument).getCall()
@@ -56,7 +56,7 @@ private predicate isVarargs(Argument arg, DataFlow::ImplicitVarargsArray varargs
}
/** Holds if `store` closes `file`. */
private predicate filesystemStore(DataFlow::Node file, Call store) {
private predicate closesFile(DataFlow::Node file, Call closeCall) {
store.getCallee() instanceof CloseFileMethod and
if store.getCallee().isStatic()
then file.asExpr() = store
@@ -67,7 +67,7 @@ private predicate filesystemStore(DataFlow::Node file, Call store) {
store = file.asExpr()
}
/** A method that closes a file. */
/** A method that closes a file, perhaps after writing some data. */
private class CloseFileMethod extends Method {
CloseFileMethod() {
this.hasQualifiedName("java.io", ["RandomAccessFile", "FileOutputStream", "PrintStream"],