Skip to content

Commit d8891e3

Browse files
committed
Small improvement to go/unhandled-writable-file-close
1 parent 7fdda87 commit d8891e3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

go/ql/src/InconsistentCode/UnhandledCloseWritableHandle.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@ predicate unhandledCall(DataFlow::CallNode call) {
7070
*/
7171
predicate isWritableFileHandle(DataFlow::Node source, DataFlow::CallNode call) {
7272
exists(OpenFileFun f, DataFlow::Node flags, QualifiedName flag |
73-
// check that the source is a result of the call
74-
source = call.getAResult() and
73+
// check that the source is the first result of the call
74+
source = call.getResult(0) and
7575
// find a call to the os.OpenFile function
7676
f.getACall() = call and
7777
// get the flags expression used for opening the file

0 commit comments

Comments
 (0)