Skip to content

Commit 11182e4

Browse files
committed
C++: Move location where getASuccessor is used to avoid join order problems
1 parent 8ac1d56 commit 11182e4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

cpp/ql/src/experimental/Security/CWE/CWE-193/InvalidPointerDeref.ql

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -208,8 +208,7 @@ predicate isInvalidPointerDerefSink(DataFlow::Node sink, Instruction i, string o
208208
s = sink.asInstruction() and
209209
bounded1(addr.getDef(), s, delta) and
210210
delta >= 0 and
211-
i.getAnOperand() = addr and
212-
i = getASuccessor(s)
211+
i.getAnOperand() = addr
213212
|
214213
i instanceof StoreInstruction and
215214
operation = "write"
@@ -267,7 +266,8 @@ newtype TMergedPathNode =
267266
TPathNodeSink(Instruction i) {
268267
exists(DataFlow::Node n |
269268
InvalidPointerToDerefFlow::flowTo(n) and
270-
isInvalidPointerDerefSink(n, i, _, _)
269+
isInvalidPointerDerefSink(n, i, _, _) and
270+
i = getASuccessor(n.asInstruction())
271271
)
272272
}
273273

0 commit comments

Comments
 (0)