Skip to content

Commit 9c5d735

Browse files
committed
C++: Add a small amount of pruning to 'SizeBarrierConfig'.
1 parent ded06a7 commit 9c5d735

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

cpp/ql/lib/semmle/code/cpp/security/InvalidPointerDereference/AllocationToInvalidPointer.qll

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,12 @@ private module InterestingPointerAddInstruction {
222222
)
223223
}
224224

225+
/**
226+
* Holds if `n` is a size of an allocation whose result flows to the left operand
227+
* of a pointer-arithmetic instruction.
228+
*
229+
* This predicate is used to reduce the set of tuples in `SizeBarrierConfig::isSource`.
230+
*/
225231
predicate isInterestingSize(DataFlow::Node n) {
226232
exists(DataFlow::Node alloc |
227233
hasSize(alloc.asConvertedExpr(), n, _) and

0 commit comments

Comments
 (0)