Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5270cf6

Browse files
committed
C++: Update documentation based on PR feedback.
1 parent a7ee27e commit 5270cf6

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@
1212
* ```
1313
* this file identifies the flow from `new int[size]` to `base + size`.
1414
*
15-
* This is done using the product-flow library. The configuration tracks flow from the pair `(allocation, size of allocation)`
16-
* to a pair `(a, b)` where there exists a pointer-arithmetic instruction `pai` such that:
17-
* 1. `a` is equal to the left-hand side of `pai`, and
18-
* 2. `b` is a dataflow node that represents an operand that _non-strictly_ upper bounds the right-hand side of `pai`.
19-
* See `pointerAddInstructionHasBounds` for the implementation of this.
15+
* This is done using the product-flow library. The configuration tracks flow from the pair
16+
* `(allocation, size of allocation)` to a pair `(a, b)` where there exists a pointer-arithmetic instruction
17+
* `pai = a + r` such that `b` is a dataflow node where `b <= r`. Because there will be a dataflow-path from
18+
* `allocation` to `a` this means that the `pai` will compute a pointer that's some number of elements away
19+
* from the end position in the allocation. See `pointerAddInstructionHasBounds` for the implementation of this.
2020
*
2121
* In the above example, the pair `(a, b)` is `(base, size)` from the expression `base + size` on line 2. However, it could
2222
* also be something more complex like `(base, size)` where `base` is from line 3 and `size` is from line 2, and the

0 commit comments

Comments
 (0)