File tree Expand file tree Collapse file tree
go/ql/src/InconsistentCode Expand file tree Collapse file tree Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments