...
Failure to understand and properly use pointer arithmetic can allow an attacker to execute arbitrary code.
Rule | Severity | LikelihoodRemediation Cost | Detectable | Repairable | Priority | Level |
|---|---|---|---|---|---|---|
ARR39-C | High | Probable | No | NoHigh | P6 | L2 |
Automated Detection
Tool | Version | Checker | Description | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Astrée |
| scaled-pointer-arithmetic | Partially checked Besides direct rule violations, Astrée reports all (resulting) out-of-bound array accesses. | ||||||||||||||||
| Axivion Bauhaus Suite |
| CertC-ARR39 | Fully implemented | ||||||||||||||||
| CodeSonar |
| LANG.MEM.BO | Buffer overrun | ||||||||||||||||
| Coverity |
| BAD_SIZEOF
| Partially implemented | ||||||||||||||||
| Cppcheck Premium |
| premium-cert-arr39-c | |||||||||||||||||
| Helix QAC |
| DF4955, DF4956, DF4957 | |||||||||||||||||
| Klocwork |
| CERT.ARR.PTR.ARITH | |||||||||||||||||
| LDRA tool suite |
| 47 S, 489 S, 567 S, 64 X, 66 X, 68 X, 69 X, 70 X, 71 X | Partially implemented | ||||||||||||||||
| Parasoft C/C++test |
| CERT_C-ARR39-a | Avoid accessing arrays out of bounds | ||||||||||||||||
| Polyspace Bug Finder |
| Checks for | :PRQA QA-C | ||||||||||||||||
| Include Page | PRQA QA-C_v | PRQA QA-C_v | 4955, 4956, 4957 | PRQA QA-C++ | |||||||||||||||
| Include Page | cplusplus:PRQA QA-C++_V | cplusplus:PRQA QA-C++_V | incorrect pointer scaling (rule fully covered). | ||||||||||||||||
| RuleChecker |
| scaled-pointer-arithmetic | Partially checked | ||||||||||||||||
| TrustInSoft Analyzer |
| index_in_address | Exhaustively detects undefined behavior (see one compliant and one non-compliant example). |
Related Vulnerabilities
Search for vulnerabilities resulting from the violation of this rule on the CERT website.
...