Skip to content

Commit 1c04344

Browse files
committed
Dataflow: Introduce consistency check for flow targeting PostUpdateNodes.
1 parent 6ddda1f commit 1c04344

File tree

5 files changed

+25
-0
lines changed

5 files changed

+25
-0
lines changed

cpp/ql/src/semmle/code/cpp/dataflow/internal/DataFlowImplConsistency.qll

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,4 +167,9 @@ module Consistency {
167167
not isImmutableOrUnobservable(n) and
168168
msg = "ArgumentNode is missing PostUpdateNode."
169169
}
170+
171+
query predicate postWithInFlow(PostUpdateNode n, string msg) {
172+
simpleLocalFlowStep(_, n) and
173+
msg = "PostUpdateNode should not be the target of local flow."
174+
}
170175
}

cpp/ql/src/semmle/code/cpp/ir/dataflow/internal/DataFlowImplConsistency.qll

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,4 +167,9 @@ module Consistency {
167167
not isImmutableOrUnobservable(n) and
168168
msg = "ArgumentNode is missing PostUpdateNode."
169169
}
170+
171+
query predicate postWithInFlow(PostUpdateNode n, string msg) {
172+
simpleLocalFlowStep(_, n) and
173+
msg = "PostUpdateNode should not be the target of local flow."
174+
}
170175
}

csharp/ql/src/semmle/code/csharp/dataflow/internal/DataFlowImplConsistency.qll

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,4 +167,9 @@ module Consistency {
167167
not isImmutableOrUnobservable(n) and
168168
msg = "ArgumentNode is missing PostUpdateNode."
169169
}
170+
171+
query predicate postWithInFlow(PostUpdateNode n, string msg) {
172+
simpleLocalFlowStep(_, n) and
173+
msg = "PostUpdateNode should not be the target of local flow."
174+
}
170175
}

java/ql/src/semmle/code/java/dataflow/internal/DataFlowImplConsistency.qll

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,4 +167,9 @@ module Consistency {
167167
not isImmutableOrUnobservable(n) and
168168
msg = "ArgumentNode is missing PostUpdateNode."
169169
}
170+
171+
query predicate postWithInFlow(PostUpdateNode n, string msg) {
172+
simpleLocalFlowStep(_, n) and
173+
msg = "PostUpdateNode should not be the target of local flow."
174+
}
170175
}

python/ql/src/experimental/dataflow/internal/DataFlowImplConsistency.qll

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,4 +167,9 @@ module Consistency {
167167
not isImmutableOrUnobservable(n) and
168168
msg = "ArgumentNode is missing PostUpdateNode."
169169
}
170+
171+
query predicate postWithInFlow(PostUpdateNode n, string msg) {
172+
simpleLocalFlowStep(_, n) and
173+
msg = "PostUpdateNode should not be the target of local flow."
174+
}
170175
}

0 commit comments

Comments
 (0)