mirror of
https://github.com/github/codeql.git
synced 2025-12-17 01:03:14 +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) {
|
predicate isWritableFileHandle(DataFlow::Node source, DataFlow::CallNode call) {
|
||||||
exists(OpenFileFun f, DataFlow::Node flags, QualifiedName flag |
|
exists(OpenFileFun f, DataFlow::Node flags, QualifiedName flag |
|
||||||
// check that the source is a result of the call
|
// check that the source is the first result of the call
|
||||||
source = call.getAResult() and
|
source = call.getResult(0) and
|
||||||
// find a call to the os.OpenFile function
|
// find a call to the os.OpenFile function
|
||||||
f.getACall() = call and
|
f.getACall() = call and
|
||||||
// get the flags expression used for opening the file
|
// get the flags expression used for opening the file
|
||||||
|
|||||||
Reference in New Issue
Block a user