Skip to content

Commit 375f0ea

Browse files
committed
C++: Update documentation.
1 parent 1e699ec commit 375f0ea

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

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

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,7 @@
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
@@ -37,9 +35,8 @@
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
*

0 commit comments

Comments
 (0)