Skip to content

Commit 06acaef

Browse files
authored
C++: fix deprecation comments in BufferWrite
1 parent a089898 commit 06acaef

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

cpp/ql/lib/semmle/code/cpp/commons/Printf.qll

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,30 +15,30 @@ private newtype TBufferWriteEstimationReason =
1515
TValueFlowAnalysis()
1616

1717
/**
18-
* A reason for a specific buffer write size estimate
18+
* A reason for a specific buffer write size estimate.
1919
*/
2020
abstract class BufferWriteEstimationReason extends TBufferWriteEstimationReason {
2121
/**
22-
* Returns the name of the concrete class
22+
* Returns the name of the concrete class.
2323
*/
2424
abstract string toString();
2525

2626
/**
27-
* Returns a human readable representation of this reason
27+
* Returns a human readable representation of this reason.
2828
*/
2929
abstract string getDescription();
3030

3131
/**
3232
* Combine estimate reasons. Used to give a reason for the size of a format string
33-
* conversion given reasons coming from its individual specifiers
33+
* conversion given reasons coming from its individual specifiers.
3434
*/
3535
abstract BufferWriteEstimationReason combineWith(BufferWriteEstimationReason other);
3636
}
3737

3838
/**
3939
* No particular reason given. This is currently used for backward compatibility so that
4040
* classes derived from BufferWrite and overriding getMaxData\0 still work with the
41-
* queries as intended
41+
* queries as intended.
4242
*/
4343
class NoSpecifiedEstimateReason extends BufferWriteEstimationReason, TNoSpecifiedEstimateReason {
4444
override string toString() { result = "NoSpecifiedEstimateReason" }
@@ -54,7 +54,7 @@ class NoSpecifiedEstimateReason extends BufferWriteEstimationReason, TNoSpecifie
5454

5555
/**
5656
* The estimation comes from rough bounds just based on the type (e.g.
57-
* `0 <= x < 2^32` for an unsigned 32 bit integer)
57+
* `0 <= x < 2^32` for an unsigned 32 bit integer).
5858
*/
5959
class TypeBoundsAnalysis extends BufferWriteEstimationReason, TTypeBoundsAnalysis {
6060
override string toString() { result = "TypeBoundsAnalysis" }

cpp/ql/lib/semmle/code/cpp/security/BufferWrite.qll

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,13 @@ abstract class BufferWrite extends Expr {
6868
/**
6969
* Gets an upper bound to the amount of data that's being written (if one
7070
* can be found).
71-
* DEPRECATED: getMaxData\1 should be used and overridden instead
71+
* DEPRECATED: `getMaxData/1` should be used and overridden instead.
7272
*/
7373
deprecated int getMaxData() { none() }
7474

7575
/**
7676
* Gets an upper bound to the amount of data that's being written (if one
77-
* can be found), specifying the reason for the estimation
77+
* can be found), specifying the reason for the estimation.
7878
*/
7979
int getMaxData(BufferWriteEstimationReason reason) {
8080
reason instanceof NoSpecifiedEstimateReason and result = getMaxData()
@@ -85,7 +85,7 @@ abstract class BufferWrite extends Expr {
8585
* can be found), except that float to string conversions are assumed to be
8686
* much smaller (8 bytes) than their true maximum length. This can be
8787
* helpful in determining the cause of a buffer overflow issue.
88-
* DEPRECATED: getMaxDataLimited\1 should be used and overridden instead
88+
* DEPRECATED: `getMaxDataLimited/1` should be used and overridden instead.
8989
*/
9090
deprecated int getMaxDataLimited() { result = getMaxData() }
9191

0 commit comments

Comments
 (0)