Skip to content

Commit f7951fb

Browse files
committed
IntegerOverflow: Improve descriptions.
1 parent 417514c commit f7951fb

File tree

7 files changed

+19
-12
lines changed

7 files changed

+19
-12
lines changed

c/cert/src/rules/INT30-C/UnsignedIntegerOperationsWrapAround.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
This query implements the CERT-C rule INT30-C:
44

55
> Ensure that unsigned integer operations do not wrap
6+
7+
68
## CERT
79

810
** REPLACE THIS BY RUNNING THE SCRIPT `scripts/help/cert-help-extraction.py` **

c/cert/src/rules/INT31-C/IntegerConversionCausesDataLoss.ql

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
/**
22
* @id c/cert/integer-conversion-causes-data-loss
33
* @name INT31-C: Ensure that integer conversions do not result in lost or misinterpreted data
4-
* @description
4+
* @description Converting an integer value to another integer type with a different sign or size
5+
* can lead to data loss or misinterpretation of the value.
56
* @kind problem
6-
* @precision high
7+
* @precision medium
78
* @problem.severity error
89
* @tags external/cert/id/int31-c
910
* correctness

c/cert/src/rules/INT32-C/SignedIntegerOverflow.ql

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
/**
22
* @id c/cert/signed-integer-overflow
33
* @name INT32-C: Ensure that operations on signed integers do not result in overflow
4-
* @description
4+
* @description The multiplication of two signed integers can lead to underflow or overflow and
5+
* therefore undefined behavior.
56
* @kind problem
6-
* @precision high
7+
* @precision medium
78
* @problem.severity error
89
* @tags external/cert/id/int32-c
910
* correctness

c/cert/src/rules/INT33-C/DivOrRemByZero.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
This query implements the CERT-C rule INT33-C:
44

55
> Ensure that division and remainder operations do not result in divide-by-zero errors
6+
7+
68
## CERT
79

810
** REPLACE THIS BY RUNNING THE SCRIPT `scripts/help/cert-help-extraction.py` **

c/cert/src/rules/INT33-C/DivOrRemByZero.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* @name INT33-C: Ensure that division and remainder operations do not result in divide-by-zero errors
44
* @description Dividing or taking the remainder by zero is undefined behavior.
55
* @kind problem
6-
* @precision high
6+
* @precision medium
77
* @problem.severity error
88
* @tags external/cert/id/int33-c
99
* correctness

c/cert/src/rules/INT35-C/UseCorrectIntegerPrecisions.ql

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
/**
22
* @id c/cert/use-correct-integer-precisions
33
* @name INT35-C: Use correct integer precisions
4-
* @description
4+
* @description The precision of integer types in C cannot be deduced from the size of the type (due
5+
* to padding and sign bits) otherwise a loss of data may occur.
56
* @kind problem
67
* @precision high
78
* @problem.severity error

rule_packages/c/IntegerOverflow.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@
2626
},
2727
"queries": [
2828
{
29-
"description": "",
29+
"description": "Converting an integer value to another integer type with a different sign or size can lead to data loss or misinterpretation of the value.",
3030
"kind": "problem",
3131
"name": "Ensure that integer conversions do not result in lost or misinterpreted data",
32-
"precision": "high",
32+
"precision": "medium",
3333
"severity": "error",
3434
"short_name": "IntegerConversionCausesDataLoss",
3535
"tags": [
@@ -45,10 +45,10 @@
4545
},
4646
"queries": [
4747
{
48-
"description": "",
48+
"description": "The multiplication of two signed integers can lead to underflow or overflow and therefore undefined behavior.",
4949
"kind": "problem",
5050
"name": "Ensure that operations on signed integers do not result in overflow",
51-
"precision": "high",
51+
"precision": "medium",
5252
"severity": "error",
5353
"short_name": "SignedIntegerOverflow",
5454
"tags": [
@@ -68,7 +68,7 @@
6868
"description": "Dividing or taking the remainder by zero is undefined behavior.",
6969
"kind": "problem",
7070
"name": "Ensure that division and remainder operations do not result in divide-by-zero errors",
71-
"precision": "high",
71+
"precision": "medium",
7272
"severity": "error",
7373
"short_name": "DivOrRemByZero",
7474
"tags": [
@@ -84,7 +84,7 @@
8484
},
8585
"queries": [
8686
{
87-
"description": "",
87+
"description": "The precision of integer types in C cannot be deduced from the size of the type (due to padding and sign bits) otherwise a loss of data may occur.",
8888
"kind": "problem",
8989
"name": "Use correct integer precisions",
9090
"precision": "high",

0 commit comments

Comments
 (0)