File tree Expand file tree Collapse file tree 1 file changed +3
-6
lines changed
cpp/ql/lib/semmle/code/cpp/security/InvalidPointerDereference Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Original file line number Diff line number Diff line change 2323 * configuration (see `InvalidPointerToDerefConfig`).
2424 *
2525 * The dataflow traversal defines the set of sources as any dataflow node `n` such that there exists a pointer-arithmetic
26- * instruction `pai` found by `AllocationToInvalidPointer.qll` and a `n.asInstruction() >= pai + deltaDerefSourceAndPai`.
27- * Here, `deltaDerefSourceAndPai` is the constant difference between the source we track for finding a dereference and the
28- * pointer-arithmetic instruction.
26+ * instruction `pai` found by `AllocationToInvalidPointer.qll` and a `n.asInstruction() = pai`.
2927 *
3028 * The set of sinks is defined as any dataflow node `n` such that `addr <= n.asInstruction() + deltaDerefSinkAndDerefAddress`
3129 * for some address operand `addr` and constant difference `deltaDerefSinkAndDerefAddress`. Since an address operand is
3735 * `deltaDerefSinkAndDerefAddress >= 0`. The load attached to `*p` is the "operation". To ensure that the path makes
3836 * intuitive sense, we only pick operations that are control-flow reachable from the dereference sink.
3937 *
40- * To compute how many elements the dereference is beyond the end position of the allocation, we sum the two deltas
41- * `deltaDerefSourceAndPai` and `deltaDerefSinkAndDerefAddress`. This is done in the `operationIsOffBy` predicate
42- * (which is the only predicate exposed by this file).
38+ * We use the `deltaDerefSinkAndDerefAddress` to compute how many elements the dereference is beyond the end position of
39+ * the allocation. This is done in the `operationIsOffBy` predicate (which is the only predicate exposed by this file).
4340 *
4441 * Handling false positives:
4542 *
You can’t perform that action at this time.
0 commit comments