Skip to content

Commit 199c864

Browse files
committed
Rename close to sink in query
1 parent f648b02 commit 199c864

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

go/ql/src/InconsistentCode/UnhandledCloseWritableHandle.ql

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -143,17 +143,17 @@ predicate precededBySync(DataFlow::Node node, DataFlow::CallNode call) {
143143

144144
from
145145
UnhandledFileCloseDataFlowConfiguration cfg, DataFlow::Node source, DataFlow::CallNode openCall,
146-
DataFlow::Node close, DataFlow::CallNode closeCall
146+
DataFlow::Node sink, DataFlow::CallNode closeCall
147147
where
148148
// find data flow from an `os.OpenFile` call to an `os.File.Close` call
149149
// where the handle is writable
150-
cfg.hasFlow(source, close) and
150+
cfg.hasFlow(source, sink) and
151151
isWritableFileHandle(source, openCall) and
152152
// get the `CallNode` corresponding to the sink
153-
isCloseSink(close, closeCall) and
153+
isCloseSink(sink, closeCall) and
154154
// check that the call to `os.File.Close` is not preceded by a checked call to
155155
// `os.File.Sync`
156-
not precededBySync(close, closeCall)
157-
select close,
156+
not precededBySync(sink, closeCall)
157+
select sink,
158158
"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.",
159159
openCall, openCall.toString()

0 commit comments

Comments
 (0)