File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
cpp/ql/lib/semmle/code/cpp/security/InvalidPointerDereference Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change 66
66
* module. Since the node we are tracking is not necessarily _equal_ to the pointer-arithmetic instruction, but rather satisfies
67
67
* `node.asInstruction() <= pai + deltaDerefSourceAndPai`, we need to account for the delta when checking if a guard is sufficiently
68
68
* strong to infer that a future dereference is safe. To do this, we check that the guard guarantees that a node `n` satisfies
69
- * `n < node + d ` where `node` is a node we know is equal to the value of the dereference source (i.e., it satisfies
70
- * `node.asInstruction() <= pai + deltaDerefSourceAndPai`) and `d <= delta `. Combining this we have
71
- * `n < node + d <= node + delta <= pai + 2*delta ` (TODO: Oops. This math doesn't quite work out. This is because we need to
72
- * redefine the `BarrierConfig` to start flow at the pointer-arithmetic instruction instead of at the dereference source. When
73
- * combined with TODO above it's easy to show that this guard ensures that the dereference is safe).
69
+ * `n < node + k ` where `node` is a node we know is equal to the value of the dereference source (i.e., it satisfies
70
+ * `node.asInstruction() <= pai + deltaDerefSourceAndPai`) and `k <= deltaDerefSourceAndPai `. Combining this we have
71
+ * `n < node + k <= node + deltaDerefSourceAndPai <= pai + 2*deltaDerefSourceAndPai ` (TODO: Oops. This math doesn't quite work out.
72
+ * I think this is because we need to redefine the `BarrierConfig` to start flow at the pointer-arithmetic instruction instead of
73
+ * at the dereference source. When combined with TODO above it's easy to show that this guard ensures that the dereference is safe).
74
74
*/
75
75
76
76
private import cpp
You can’t perform that action at this time.
0 commit comments