...
This is a subtle error that results in a disturbingly broad range of potentially severe vulnerabilities. At the very least, this error can lead to unexpected numerical results on different platforms. Unexpected arithmetic values when applied to arrays or pointers can yield buffer overflows or other invalid memory access.
Recommendation | Severity | Likelihood | Remediation Cost | Priority | Level |
---|---|---|---|---|---|
INT07-C | Medium | Probable | Medium | P8 | L2 |
Automated Detection
Tool | Version | Checker | Description | ||||
---|---|---|---|---|---|---|---|
Astrée |
|
Supported indirectly via MISRA C:2012 rules 10.1, 10.3 and 10.4. | |||||||||
Axivion Bauhaus Suite |
| CertC-INT07 | |||||||
CodeSonar |
| LANG.TYPE.IOT | Inappropriate operand type | ||||||
Compass/ROSE |
Can detect violations of this recommendation. In particular, it flags any instance of a variable of type | |||||||||
| CC2.INT07 | Fully implemented | |||||||
Helix QAC |
| C1292, C1293, C4401, C4421, C4431, C4441, C4451 | |||||||
Klocwork |
| PORTING.SIGNED.CHAR |
LDRA tool suite |
| 93 S, 96 S, 101 S, 329 S, 432 S, 458 S | Fully implemented | ||||||
Parasoft C/C++test |
|
|
|
1292, 1293, 4401, 4421, 4431, 4441, 4451
CERT_C-INT07-a | The plain char type shall be used only for the storage and use of character values | ||||||||
PC-lint Plus |
| 9112 | Fully supported | ||||||
| Checks for use of plain char type for numeric value (rec. fully covered) | ||||||||
Splint |
| ||||||||
RuleChecker |
| Supported indirectly via MISRA C:2012 rules 10.1, 10.3 and 10.4. |
SonarQube C/C++ Plugin |
| S820 |
Related Vulnerabilities
Search for vulnerabilities resulting from the violation of this rule on the CERT website.
Related Guidelines
SEI CERT C++ Coding Standard | VOID INT07-CPP. Use only explicitly signed or unsigned char type for numeric values |
ISO/IEC TR 24772:2013 | Bit Representations [STR] |
MISRA C:2012 | Rule 10.1 (required) Rule 10.3 (required) Rule 10.4 (required) |
MITRE CWE | CWE-682, Incorrect calculation |
...
...