Skip to content

Commit faf846b

Browse files
committed
C++: Disable flow through nodes that are sources of phi edges' back edges.
1 parent 205bb76 commit faf846b

File tree

3 files changed

+9
-168
lines changed

3 files changed

+9
-168
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,8 @@ module InvalidPointerToDerefConfig implements DataFlow::ConfigSig {
229229

230230
pragma[inline]
231231
predicate isSink(DataFlow::Node sink) { isInvalidPointerDerefSink(sink, _, _) }
232+
233+
predicate isBarrier(DataFlow::Node node) { node = any(DataFlow::SsaPhiNode phi).getAnInput(true) }
232234
}
233235

234236
module InvalidPointerToDerefFlow = DataFlow::Global<InvalidPointerToDerefConfig>;

0 commit comments

Comments
 (0)