diff --git a/cpp/ql/lib/semmle/code/cpp/security/InvalidPointerDereference/InvalidPointerToDereference.qll b/cpp/ql/lib/semmle/code/cpp/security/InvalidPointerDereference/InvalidPointerToDereference.qll index 501a1ed1d15..4a2175809e6 100644 --- a/cpp/ql/lib/semmle/code/cpp/security/InvalidPointerDereference/InvalidPointerToDereference.qll +++ b/cpp/ql/lib/semmle/code/cpp/security/InvalidPointerDereference/InvalidPointerToDereference.qll @@ -174,6 +174,8 @@ private module InvalidPointerToDerefConfig implements DataFlow::StateConfigSig { } predicate isBarrier(DataFlow::Node node, FlowState pai) { + // `node = getABarrierNode(pai)` ensures that node < pai, so this node is safe to dereference. + // Note that this is the only place where the `FlowState` is used in this configuration. node = InvalidPointerToDerefBarrier::getABarrierNode(pai) } }