Tidy up comments in isSink

This commit is contained in:
Owen Mansel-Chan
2026-06-04 13:14:58 +01:00
parent 101812310c
commit 50e0354911

View File

@@ -118,17 +118,13 @@ module UnhandledFileCloseConfig implements DataFlow::ConfigSig {
predicate isSource(DataFlow::Node source) { isWritableFileHandle(source, _) }
predicate isSink(DataFlow::Node sink) {
// `closeCall` is an unhandled call to `os.File.Close` on `sink` that is not
// guaranteed to be preceded during execution by a handled call to `os.File.Sync` on the
// same file handle.
exists(DataFlow::CallNode closeCall |
// find calls to the os.File.Close function
// `closeCall` is an unhandled call to `os.File.Close` on `sink`
closeCall = any(CloseFileFun f).getACall() and
// that are unhandled
unhandledCall(closeCall) and
// where the function is called on the sink
closeCall.getReceiver() = sink and
// and check that the call to `os.File.Close` is not guaranteed to be preceded during
closeCall.getReceiver() = sink
|
// `closeCall` is not guaranteed to be preceded during
// execution by a handled call to `os.File.Sync` on the same file handle.
not exists(DataFlow::Node syncReceiver, DataFlow::CallNode syncCall |
// check that the call to `os.File.Sync` is handled