Skip to content

Commit c87bfd5

Browse files
committed
Remove redundant call to isCloseSink
1 parent 05e21ad commit c87bfd5

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

go/ql/src/InconsistentCode/UnhandledCloseWritableHandle.ql

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -176,14 +176,12 @@ import UnhandledFileCloseFlow::PathGraph
176176

177177
from
178178
UnhandledFileCloseFlow::PathNode source, DataFlow::CallNode openCall,
179-
UnhandledFileCloseFlow::PathNode sink, DataFlow::CallNode closeCall
179+
UnhandledFileCloseFlow::PathNode sink
180180
where
181181
// find data flow from an `os.OpenFile` call to an `os.File.Close` call
182182
// where the handle is writable
183183
UnhandledFileCloseFlow::flowPath(source, sink) and
184-
isWritableFileHandle(source.getNode(), openCall) and
185-
// get the `CallNode` corresponding to the sink
186-
isCloseSink(sink.getNode(), closeCall)
184+
isWritableFileHandle(source.getNode(), openCall)
187185
select sink, source, sink,
188186
"File handle may be writable as a result of data flow from a $@ and closing it may result in data loss upon failure, which is not handled explicitly.",
189187
openCall, openCall.toString()

0 commit comments

Comments
 (0)