From 55aedbc46cbe3ee1281a6d8122963e1c87a91557 Mon Sep 17 00:00:00 2001 From: Tom Hvitved Date: Mon, 4 Sep 2023 15:41:36 +0200 Subject: [PATCH] C#: Fix logic for flow into property writes --- .../code/csharp/dataflow/internal/DataFlowPrivate.qll | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/csharp/ql/lib/semmle/code/csharp/dataflow/internal/DataFlowPrivate.qll b/csharp/ql/lib/semmle/code/csharp/dataflow/internal/DataFlowPrivate.qll index 308df381a121..f4b5abf69c6e 100644 --- a/csharp/ql/lib/semmle/code/csharp/dataflow/internal/DataFlowPrivate.qll +++ b/csharp/ql/lib/semmle/code/csharp/dataflow/internal/DataFlowPrivate.qll @@ -1165,8 +1165,14 @@ private module ArgumentNodes { ) { e1.(Argument).isArgumentOf(e2, _) and exactScope = false and - scope = e2 and - isSuccessor = true + isSuccessor = true and + if e2 instanceof PropertyWrite + then + exists(AssignableDefinition def | + def.getTargetAccess() = e2 and + scope = def.getExpr() + ) + else scope = e2 } }