C++: Only allow implicit reads of fields that exist on the sink node's type.

This commit is contained in:
Mathias Vorreiter Pedersen
2023-02-08 13:08:22 +00:00
parent ad8e82ac65
commit 825628675e

View File

@@ -106,7 +106,7 @@ module IRTest {
override predicate allowImplicitRead(DataFlow::Node node, DataFlow::ContentSet c) {
// allow arbitrary reads at sinks
isSink(node) and
c = any(DataFlow::ContentSet c_)
c.(DataFlow::FieldContent).getField().getDeclaringType() = node.getType().getUnspecifiedType()
}
}
}