Skip to content

Commit 0ebf529

Browse files
Add comment + use flowTo
1 parent a4d7570 commit 0ebf529

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

csharp/ql/lib/semmle/code/csharp/security/dataflow/flowsinks/ExternalLocationSink.qll

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ private predicate isFileWriteCall(Expr stream, Expr data) {
8282
)
8383
}
8484

85+
/** A configuration for tracking flow from calls that open a file in write mode to methods that write to that file, excluding encrypted streams. */
8586
private module LocalFileOutputStreamConfig implements DataFlow::ConfigSig {
8687
predicate isSource(DataFlow::Node src) { sourceNode(src, "file-write") }
8788

@@ -111,7 +112,7 @@ private module LocalFileOutputStreamFlow = DataFlow::Global<LocalFileOutputStrea
111112
class LocalFileOutputSink extends ExternalLocationSink {
112113
LocalFileOutputSink() {
113114
exists(DataFlow::Node streamSink |
114-
LocalFileOutputStreamFlow::flow(_, streamSink) and
115+
LocalFileOutputStreamFlow::flowTo(streamSink) and
115116
isFileWriteCall(streamSink.asExpr(), this.asExpr())
116117
)
117118
}

0 commit comments

Comments
 (0)