Skip to content

Commit 412bd32

Browse files
author
Benjamin Muskalla
committed
Move more predicates into configuration
1 parent b84c036 commit 412bd32

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

java/ql/src/utils/model-generator/CaptureSummaryModels.ql

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,11 @@ class FieldToReturnConfig extends TaintTracking::Configuration {
4747
source instanceof DataFlow::InstanceParameterNode
4848
}
4949

50-
override predicate isSink(DataFlow::Node sink) { sink instanceof ReturnNodeExt }
50+
override predicate isSink(DataFlow::Node sink) {
51+
sink instanceof ReturnNodeExt and
52+
not sink.(ReturnNode).asExpr().(ThisAccess).isOwnInstanceAccess() and
53+
not exists(captureQualifierFlow(sink.asExpr().getEnclosingCallable()))
54+
}
5155

5256
override predicate isAdditionalTaintStep(DataFlow::Node node1, DataFlow::Node node2) {
5357
exists(DataFlow::Content f |
@@ -97,11 +101,7 @@ string captureFieldFlow(TargetAPI api) {
97101
config.hasFlow(_, returnNodeExt) and
98102
returnNodeExt.getEnclosingCallable() = api and
99103
not api.getDeclaringType() instanceof EnumType and
100-
isRelevantType(returnNodeExt.getType()) and
101-
not (
102-
returnNodeExt.getKind() instanceof ValueReturnKind and
103-
exists(captureQualifierFlow(api))
104-
)
104+
isRelevantType(returnNodeExt.getType())
105105
|
106106
result = asTaintModel(api, "Argument[-1]", asOutput(api, returnNodeExt))
107107
)

0 commit comments

Comments
 (0)