mirror of
https://github.com/github/codeql.git
synced 2025-12-22 11:46:32 +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.
|
||||
</p>
|
||||
|
||||
<sample src="PointerWrapAround-bad.cpp" />
|
||||
<sample src="PointerOverflow-bad.cpp" />
|
||||
|
||||
<p>
|
||||
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
|
||||
range of an allocation between <code>ptr</code> and <code>ptr_end</code>.
|
||||
</p>
|
||||
<sample src="PointerWrapAround-good.cpp" />
|
||||
<sample src="PointerOverflow-good.cpp" />
|
||||
</example>
|
||||
<references>
|
||||
<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
|
||||
* @description Adding a value to a pointer
|
||||
* to see if it "wraps around" is dangerous because it relies
|
||||
* @name Range check relying on pointer overflow
|
||||
* @description Adding a value to a pointer to see if it overflows relies
|
||||
* on undefined behavior and may lead to memory corruption.
|
||||
* @kind problem
|
||||
* @problem.severity error
|
||||
* @precision high
|
||||
* @id cpp/pointer-wrap-around
|
||||
* @id cpp/pointer-overflow
|
||||
* @tags reliability
|
||||
* 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