Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Added Polyspace Bug Finder

...

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
Include Page
Astrée_V
Astrée_V
 

Supported, but no explicit checker
CodeSonar
Include Page
CodeSonar_V
CodeSonar_V
LANG.TYPE.IOTInappropriate operand type
Compass/ROSE

 

 



Can detect violations of this recommendation. In particular, it flags any instance of a variable of type char (without a signed or unsigned qualifier) that appears in an arithmetic expression

ECLAIR

Include Page
ECLAIR_V
ECLAIR_V

CC2.INT07

Fully implemented

Klocwork
Include Page
Klocwork_V
Klocwork_V
PORTING.SIGNED.CHAR
 

LDRA tool suite
Include Page
LDRA_V
LDRA_V

93 S, 96 S, 101 S, 329 S, 432 S, 458 S

Fully implemented

Parasoft C/C++test
Include Page
c:
Parasoft_V
c:
Parasoft_V
MISRA2004-6_{1,2}Fully implemented

Polyspace Bug Finder

R2016bUse of plain char type for numerical valuePlain char variable in arithmetic operation without explicit signedness
Splint
Include Page
Splint_V
Splint_V

 

 



PRQA QA-C
Include Page
PRQA QA-C_v
PRQA QA-C_v

1292, 1293, 4401, 4421, 4431, 4441, 4451

 


Partially implemented
SonarQube C/C++ Plugin
Include Page
SonarQube C/C++ Plugin_V
SonarQube C/C++ Plugin_V
S820
 

Related Vulnerabilities

Search for vulnerabilities resulting from the violation of this rule on the CERT website.

Related Guidelines

SEI CERT C++ Coding StandardVOID INT07-CPP. Use only explicitly signed or unsigned char type for numeric values
ISO/IEC TR 24772:2013Bit Representations [STR]
MISRA C:2012Rule 10.1 (required)
Rule 10.3 (required)
Rule 10.4 (required)
MITRE CWECWE-682, Incorrect calculation

...


...