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 23
23
* configuration (see `InvalidPointerToDerefConfig`).
24
24
*
25
25
* 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`.
29
27
*
30
28
* The set of sinks is defined as any dataflow node `n` such that `addr <= n.asInstruction() + deltaDerefSinkAndDerefAddress`
31
29
* for some address operand `addr` and constant difference `deltaDerefSinkAndDerefAddress`. Since an address operand is
37
35
* `deltaDerefSinkAndDerefAddress >= 0`. The load attached to `*p` is the "operation". To ensure that the path makes
38
36
* intuitive sense, we only pick operations that are control-flow reachable from the dereference sink.
39
37
*
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).
43
40
*
44
41
* Handling false positives:
45
42
*
You can’t perform that action at this time.
0 commit comments