Skip to content

Commit f7050ec

Browse files
committed
Tidy up commens in isSink
1 parent dbee8fc commit f7050ec

1 file changed

Lines changed: 4 additions & 8 deletions

File tree

go/ql/src/InconsistentCode/UnhandledCloseWritableHandle.ql

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -118,17 +118,13 @@ module UnhandledFileCloseConfig implements DataFlow::ConfigSig {
118118
predicate isSource(DataFlow::Node source) { isWritableFileHandle(source, _) }
119119

120120
predicate isSink(DataFlow::Node sink) {
121-
// `closeCall` is an unhandled call to `os.File.Close` on `sink` that is not
122-
// guaranteed to be preceded during execution by a handled call to `os.File.Sync` on the
123-
// same file handle.
124121
exists(DataFlow::CallNode closeCall |
125-
// find calls to the os.File.Close function
122+
// `closeCall` is an unhandled call to `os.File.Close` on `sink`
126123
closeCall = any(CloseFileFun f).getACall() and
127-
// that are unhandled
128124
unhandledCall(closeCall) and
129-
// where the function is called on the sink
130-
closeCall.getReceiver() = sink and
131-
// and check that the call to `os.File.Close` is not guaranteed to be preceded during
125+
closeCall.getReceiver() = sink
126+
|
127+
// `closeCall` is not guaranteed to be preceded during
132128
// execution by a handled call to `os.File.Sync` on the same file handle.
133129
not exists(DataFlow::Node syncReceiver, DataFlow::CallNode syncCall |
134130
// check that the call to `os.File.Sync` is handled

0 commit comments

Comments
 (0)