mirror of
https://github.com/github/codeql.git
synced 2025-12-24 04:36:35 +01:00
C++: Rename PointerWrapAround to PointerOverflow
Overflow was the terminology I found for this in the C standard (C11 6.5.6-8).
This commit is contained in:
@@ -38,7 +38,7 @@ checking if adding it to <code>ptr</code> creates a pointer so large that it
|
|||||||
overflows and wraps around.
|
overflows and wraps around.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<sample src="PointerWrapAround-bad.cpp" />
|
<sample src="PointerOverflow-bad.cpp" />
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
In both of these checks, the operations are performed in the wrong order.
|
In both of these checks, the operations are performed in the wrong order.
|
||||||
@@ -60,7 +60,7 @@ allocation.
|
|||||||
The next example shows how to portably check whether a number is outside the
|
The next example shows how to portably check whether a number is outside the
|
||||||
range of an allocation between <code>ptr</code> and <code>ptr_end</code>.
|
range of an allocation between <code>ptr</code> and <code>ptr_end</code>.
|
||||||
</p>
|
</p>
|
||||||
<sample src="PointerWrapAround-good.cpp" />
|
<sample src="PointerOverflow-good.cpp" />
|
||||||
</example>
|
</example>
|
||||||
<references>
|
<references>
|
||||||
<li><a href="https://blog.regehr.org/archives/1395">Pointer Overflow Checking [Embedded in Academia]</a></li>
|
<li><a href="https://blog.regehr.org/archives/1395">Pointer Overflow Checking [Embedded in Academia]</a></li>
|
||||||
@@ -1,12 +1,11 @@
|
|||||||
/**
|
/**
|
||||||
* @name Reliance on pointer wrap-around
|
* @name Range check relying on pointer overflow
|
||||||
* @description Adding a value to a pointer
|
* @description Adding a value to a pointer to see if it overflows relies
|
||||||
* to see if it "wraps around" is dangerous because it relies
|
|
||||||
* on undefined behavior and may lead to memory corruption.
|
* on undefined behavior and may lead to memory corruption.
|
||||||
* @kind problem
|
* @kind problem
|
||||||
* @problem.severity error
|
* @problem.severity error
|
||||||
* @precision high
|
* @precision high
|
||||||
* @id cpp/pointer-wrap-around
|
* @id cpp/pointer-overflow
|
||||||
* @tags reliability
|
* @tags reliability
|
||||||
* security
|
* security
|
||||||
*/
|
*/
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
Likely Bugs/Memory Management/PointerOverflow.ql
|
||||||
@@ -1 +0,0 @@
|
|||||||
Likely Bugs/Memory Management/PointerWrapAround.ql
|
|
||||||
Reference in New Issue
Block a user