File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed
cpp/ql/src/Likely Bugs/Memory Management Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ overflows and wraps around.
4242
4343<p >
4444In both of these checks, the operations are performed in the wrong order.
45- First, an expression that may lead to undefined behavior is evaluated
45+ First, an expression that may cause undefined behavior is evaluated
4646(<code >ptr + a</code >), and then the result is checked for being in range.
4747But once undefined behavior has happened in the pointer addition, it cannot
4848be recovered from: it's too late to perform the range check after a possible
@@ -57,7 +57,7 @@ allocation.
5757</p >
5858
5959<p >
60- The next example shows how to portably check whether a number is outside the
60+ The next example shows how to portably check whether an unsigned number is outside the
6161range of an allocation between <code >ptr</code > and <code >ptr_end</code >.
6262</p >
6363<sample src =" PointerOverflow-good.cpp" />
Original file line number Diff line number Diff line change 11/**
22 * @name Pointer overflow check
3- * @description Adding a value to a pointer to see if it overflows relies
3+ * @description Adding a value to a pointer to check if it overflows relies
44 * on undefined behavior and may lead to memory corruption.
55 * @kind problem
66 * @problem.severity error
You can’t perform that action at this time.
0 commit comments