mirror of
https://github.com/github/codeql.git
synced 2025-12-16 16:53:25 +01:00
Small improvement to go/unhandled-writable-file-close
This commit is contained in:
@@ -70,8 +70,8 @@ predicate unhandledCall(DataFlow::CallNode call) {
|
||||
*/
|
||||
predicate isWritableFileHandle(DataFlow::Node source, DataFlow::CallNode call) {
|
||||
exists(OpenFileFun f, DataFlow::Node flags, QualifiedName flag |
|
||||
// check that the source is a result of the call
|
||||
source = call.getAResult() and
|
||||
// check that the source is the first result of the call
|
||||
source = call.getResult(0) and
|
||||
// find a call to the os.OpenFile function
|
||||
f.getACall() = call and
|
||||
// get the flags expression used for opening the file
|
||||
|
||||
Reference in New Issue
Block a user