Skip to content

Commit dd267b3

Browse files
committed
C#: Move isRelevantMemberAccess out of PropagateToSinkConfigurationSpecific.
1 parent 3933dfa commit dd267b3

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

csharp/ql/src/utils/model-generator/internal/CaptureModelsSpecific.qll

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -107,24 +107,24 @@ string qualifierString() { result = "Argument[Qualifier]" }
107107
bindingset[kind]
108108
predicate isRelevantSinkKind(string kind) { any() }
109109

110+
private predicate isRelevantMemberAccess(DataFlow::Node node) {
111+
exists(CS::MemberAccess access | access = node.asExpr() |
112+
access.hasThisQualifier() and
113+
access.getTarget().isEffectivelyPublic() and
114+
(
115+
access instanceof CS::FieldAccess
116+
or
117+
access.getTarget().(CS::Property).getSetter().isPublic()
118+
)
119+
)
120+
}
121+
110122
/**
111123
* Language specific parts of the `PropagateToSinkConfiguration`.
112124
*/
113125
class PropagateToSinkConfigurationSpecific extends CS::TaintTracking::Configuration {
114126
PropagateToSinkConfigurationSpecific() { this = "parameters or fields flowing into sinks" }
115127

116-
private predicate isRelevantMemberAccess(DataFlow::Node node) {
117-
exists(CS::MemberAccess access | access = node.asExpr() |
118-
access.hasThisQualifier() and
119-
access.getTarget().isEffectivelyPublic() and
120-
(
121-
access instanceof CS::FieldAccess
122-
or
123-
access.getTarget().(CS::Property).getSetter().isPublic()
124-
)
125-
)
126-
}
127-
128128
override predicate isSource(DataFlow::Node source) {
129129
(isRelevantMemberAccess(source) or source instanceof DataFlow::ParameterNode) and
130130
isRelevantForModels(source.getEnclosingCallable())

0 commit comments

Comments
 (0)