Restrict field access to corresponding type

This commit is contained in:
Benjamin Muskalla
2021-11-09 11:42:49 +01:00
parent 6960a7b97e
commit a546b38ee0

View File

@@ -96,8 +96,8 @@ class ParameterToFieldConfig extends TaintTracking::Configuration {
override predicate isSink(DataFlow::Node sink) {
exists(FieldAssignment a |
a.getSource() = sink.asExpr() and
a.getDest().(VarAccess).getVariable().getCompilationUnit() =
sink.getEnclosingCallable().getCompilationUnit()
a.getDest().(FieldAccess).getField().getDeclaringType() =
sink.getEnclosingCallable().getDeclaringType()
)
}
}