Skip to content

Commit b5d6a6d

Browse files
committed
C#: Use the same types as sanitizers for source and sink model as we use for summary model generation.
1 parent 031e44b commit b5d6a6d

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

csharp/ql/src/utils/modelgenerator/internal/CaptureModels.qll

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,10 @@ module FromSourceConfig implements DataFlow::ConfigSig {
225225

226226
DataFlow::FlowFeature getAFeature() { result instanceof DataFlow::FeatureHasSinkCallContext }
227227

228+
predicate isBarrier(DataFlow::Node n) {
229+
exists(Type t | t = n.getType() and not isRelevantType(t))
230+
}
231+
228232
predicate isAdditionalFlowStep(DataFlow::Node node1, DataFlow::Node node2) {
229233
isRelevantTaintStep(node1, node2)
230234
}
@@ -257,7 +261,11 @@ module PropagateToSinkConfig implements DataFlow::ConfigSig {
257261

258262
predicate isSink(DataFlow::Node sink) { ExternalFlow::sinkNode(sink, _) }
259263

260-
predicate isBarrier(DataFlow::Node node) { sinkModelSanitizer(node) }
264+
predicate isBarrier(DataFlow::Node node) {
265+
exists(Type t | t = node.getType() and not isRelevantType(t))
266+
or
267+
sinkModelSanitizer(node)
268+
}
261269

262270
DataFlow::FlowFeature getAFeature() { result instanceof DataFlow::FeatureHasSourceCallContext }
263271

0 commit comments

Comments
 (0)