Skip to content

Commit c49c230

Browse files
authored
Merge pull request #923 from geoffw0/potentialbufferoverflow
CPP: Deprecate PotentialBufferOverflow.ql
2 parents b8f8ed5 + 25a5ff5 commit c49c230

File tree

16 files changed

+35
-24
lines changed

16 files changed

+35
-24
lines changed

change-notes/1.20/analysis-cpp.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
| Mismatching new/free or malloc/delete (`cpp/new-free-mismatch`) | More correct results | Data flow through global variables for this query has been improved. |
3434
| Use of inherently dangerous function (`cpp/potential-buffer-overflow`) | Cleaned up | This query no longer catches uses of `gets`, and has been renamed 'Potential buffer overflow'. |
3535
| Use of potentially dangerous function (`cpp/potentially-dangerous-function`) | More correct results | This query now catches uses of `gets`. |
36+
| Potential buffer overflow (`cpp/potential-buffer-overflow`) | Deprecated | This query has been deprecated. Use Potentially overrunning write (`cpp/overrunning-write`) and Potentially overrunning write with float to string conversion (`cpp/overrunning-write-with-float`) instead. |
3637

3738
## Changes to QL libraries
3839

cpp/config/suites/security/cwe-242

Lines changed: 0 additions & 3 deletions
This file was deleted.

cpp/config/suites/security/default

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
@import "cwe-134"
1313
@import "cwe-170"
1414
@import "cwe-190"
15-
@import "cwe-242"
1615
@import "cwe-253"
1716
@import "cwe-290"
1817
@import "cwe-311"

cpp/ql/src/Likely Bugs/Memory Management/PotentialBufferOverflow.ql

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
* @tags reliability
1010
* security
1111
* external/cwe/cwe-676
12+
* @deprecated This query is deprecated, use
13+
* Security/CWE/CWE-120/OverrunWrite.ql and
14+
* Security/CWE/CWE-120/OverrunWriteFloat.ql instead.
1215
*/
1316
import cpp
1417
import semmle.code.cpp.commons.Buffer

cpp/ql/src/Likely Bugs/OO/NonVirtualDestructor.ql

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@
77
* @id cpp/non-virtual-destructor
88
* @problem.severity warning
99
* @tags reliability
10-
* @deprecated
10+
* @deprecated This query is deprecated, and replaced by
11+
* jsf/4.10 Classes/AV Rule 78.ql, which has far fewer false
12+
* positives on typical code.
1113
*/
1214

13-
// This query is deprecated, and replaced by jsf/4.10 Classes/AV Rule 78.ql, which has far fewer false positives on typical code.
14-
1515
import cpp
1616

1717
from Class base, Destructor d1, Class derived, Destructor d2

cpp/ql/src/PointsTo/Debug.ql

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,9 @@
33
* @description Query to help investigate mysterious results with ReturnStackAllocatedObject
44
* @kind table
55
* @id cpp/points-to/debug
6-
* @deprecated
6+
* @deprecated This query is not suitable for production use and has been deprecated.
77
*/
88

9-
// This query is not suitable for production use and has been deprecated.
10-
119
import cpp
1210
import semmle.code.cpp.pointsto.PointsTo
1311

cpp/ql/src/PointsTo/PreparedStagedPointsTo.ql

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,9 @@
33
* @description Query to force evaluation of staged points-to predicates
44
* @kind table
55
* @id cpp/points-to/prepared-staged-points-to
6-
* @deprecated
6+
* @deprecated This query is not suitable for production use and has been deprecated.
77
*/
88

9-
// This query is not suitable for production use and has been deprecated.
10-
119
import semmle.code.cpp.pointsto.PointsTo
1210

1311
select count(int set, Element location | setlocations(set, unresolveElement(location))),

cpp/ql/src/PointsTo/Stats.ql

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,9 @@
33
* @description Count the number points-to sets with 0 or 1 incoming flow edges, and the total number of points-to sets
44
* @kind table
55
* @id cpp/points-to/stats
6-
* @deprecated
6+
* @deprecated This query is not suitable for production use and has been deprecated.
77
*/
88

9-
// This query is not suitable for production use and has been deprecated.
10-
119
import cpp
1210
import semmle.code.cpp.pointsto.PointsTo
1311

cpp/ql/src/PointsTo/TaintedFormatStrings.ql

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,9 @@
22
* @name Taint test
33
* @kind table
44
* @id cpp/points-to/tainted-format-strings
5-
* @deprecated
5+
* @deprecated This query is not suitable for production use and has been deprecated.
66
*/
77

8-
// This query is not suitable for production use and has been deprecated.
9-
108
import cpp
119
import semmle.code.cpp.pointsto.PointsTo
1210
import semmle.code.cpp.pointsto.CallGraph
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
| tests.cpp:258:2:258:8 | call to sprintf | This 'call to sprintf' operation requires 17 bytes but the destination is only 10 bytes. |
2+
| tests.cpp:259:2:259:8 | call to sprintf | This 'call to sprintf' operation requires 17 bytes but the destination is only 10 bytes. |
3+
| tests.cpp:272:2:272:8 | call to sprintf | This 'call to sprintf' operation requires 9 bytes but the destination is only 8 bytes. |
4+
| tests.cpp:273:2:273:8 | call to sprintf | This 'call to sprintf' operation requires 9 bytes but the destination is only 8 bytes. |

0 commit comments

Comments
 (0)