Skip to content

Commit 8ed9917

Browse files
committed
C++: Rename PointerWrapAround to PointerOverflow
Overflow was the terminology I found for this in the C standard (C11 6.5.6-8).
1 parent bd08c64 commit 8ed9917

8 files changed

Lines changed: 6 additions & 7 deletions

File tree

cpp/ql/src/Likely Bugs/Memory Management/PointerWrapAround-bad.cpp renamed to cpp/ql/src/Likely Bugs/Memory Management/PointerOverflow-bad.cpp

File renamed without changes.

cpp/ql/src/Likely Bugs/Memory Management/PointerWrapAround-good.cpp renamed to cpp/ql/src/Likely Bugs/Memory Management/PointerOverflow-good.cpp

File renamed without changes.

cpp/ql/src/Likely Bugs/Memory Management/PointerWrapAround.qhelp renamed to cpp/ql/src/Likely Bugs/Memory Management/PointerOverflow.qhelp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ checking if adding it to <code>ptr</code> creates a pointer so large that it
3838
overflows and wraps around.
3939
</p>
4040

41-
<sample src="PointerWrapAround-bad.cpp" />
41+
<sample src="PointerOverflow-bad.cpp" />
4242

4343
<p>
4444
In both of these checks, the operations are performed in the wrong order.
@@ -60,7 +60,7 @@ allocation.
6060
The next example shows how to portably check whether a number is outside the
6161
range of an allocation between <code>ptr</code> and <code>ptr_end</code>.
6262
</p>
63-
<sample src="PointerWrapAround-good.cpp" />
63+
<sample src="PointerOverflow-good.cpp" />
6464
</example>
6565
<references>
6666
<li><a href="https://blog.regehr.org/archives/1395">Pointer Overflow Checking [Embedded in Academia]</a></li>

cpp/ql/src/Likely Bugs/Memory Management/PointerWrapAround.ql renamed to cpp/ql/src/Likely Bugs/Memory Management/PointerOverflow.ql

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
/**
2-
* @name Reliance on pointer wrap-around
3-
* @description Adding a value to a pointer
4-
* to see if it "wraps around" is dangerous because it relies
2+
* @name Range check relying on pointer overflow
3+
* @description Adding a value to a pointer to see if it overflows relies
54
* on undefined behavior and may lead to memory corruption.
65
* @kind problem
76
* @problem.severity error
87
* @precision high
9-
* @id cpp/pointer-wrap-around
8+
* @id cpp/pointer-overflow
109
* @tags reliability
1110
* security
1211
*/

cpp/ql/test/query-tests/Likely Bugs/Memory Management/PointerOverflowCheck/PointerWrapAround.expected renamed to cpp/ql/test/query-tests/Likely Bugs/Memory Management/PointerOverflow/PointerOverflow.expected

File renamed without changes.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Likely Bugs/Memory Management/PointerOverflow.ql

cpp/ql/test/query-tests/Likely Bugs/Memory Management/PointerOverflowCheck/test.cpp renamed to cpp/ql/test/query-tests/Likely Bugs/Memory Management/PointerOverflow/test.cpp

File renamed without changes.

cpp/ql/test/query-tests/Likely Bugs/Memory Management/PointerOverflowCheck/PointerWrapAround.qlref

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)