...
Tool | Version | Checker | Description | ||||||
|---|---|---|---|---|---|---|---|---|---|
| Astrée |
| char-sign-conversion | Fully checked | ||||||
| Axivion Bauhaus Suite |
| CertC-STR34 | Fully implemented | ||||||
| CodeSonar |
| MISC.NEGCHAR | Negative Character Value | ||||||
| Compass/ROSE | Can detect violations of this rule when checking for violations of INT07-C. Use only explicitly signed or unsigned char type for numeric values | ||||||||
| Coverity |
| MISRA C 2012 Rule 10.1 MISRA C 2012 Rule 10.2 MISRA C 2012 Rule 10.3 MISRA C 2012 Rule 10.4 | Implemented Essential type checkers | ||||||
| Cppcheck Premium |
| premium-cert-str34-c | Partially implemented | ||||||
| CC2.STR34 | Fully implemented | |||||||
| GCC | 2.95 and later | Detects objects of type | |||||||
| Helix QAC |
| C2140, C2141, C2143, C2144, C2145, C2147, C2148, C2149, C2151, C2152, C2153, C2155 C++3051 | |||||||
| Klocwork |
| CXX.CAST.SIGNED_CHAR_TO_INTEGER | |||||||
| LDRA tool suite |
| 434 S | Partially implemented | ||||||
| Parasoft C/C++test |
| CERT_C-STR34-b | Cast characters to unsigned char before assignment to larger integer sizes | ||||||
| PC-lint Plus |
| 571 | Partially supported | ||||||
| CERT C: Rule STR34-C | Checks for misuse of sign-extended character value (rule fully covered) | |||||||
| RuleChecker |
| char-sign-conversion | Fully checked | ||||||
| TrustInSoft Analyzer |
| out of bounds read | Partially verified (exhaustively detects undefined behavior). |
Related Vulnerabilities
CVE-2009-0887 results from a violation of this rule. In Linux PAM (up to version 1.0.3), the libpam implementation of strtok() casts a (potentially signed) character to an integer for use as an index to an array. An attacker can exploit this vulnerability by inputting a string with non-ASCII characters, causing the cast to result in a negative index and accessing memory outside of the array [xorl 2009].
...