mirror of
https://github.com/github/codeql.git
synced 2026-04-28 18:25:24 +02:00
Use any instead of exists for isCloseSink
This commit is contained in:
@@ -90,14 +90,12 @@ predicate isWritableFileHandle(DataFlow::Node source, DataFlow::CallNode call) {
|
||||
* Determines whether `os.File.Close` is called on `sink`.
|
||||
*/
|
||||
predicate isCloseSink(DataFlow::Node sink, DataFlow::CallNode call) {
|
||||
exists(CloseFileFun f |
|
||||
// find calls to the os.File.Close function
|
||||
f.getACall() = call and
|
||||
// that are deferred
|
||||
unhandledCall(call) and
|
||||
// where the function is called on the sink
|
||||
call.getReceiver() = sink
|
||||
)
|
||||
// find calls to the os.File.Close function
|
||||
call = any(CloseFileFun f).getACall() and
|
||||
// that are deferred
|
||||
unhandledCall(call) and
|
||||
// where the function is called on the sink
|
||||
call.getReceiver() = sink
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user