 
                            ...
Failure to understand and properly use pointer arithmetic can allow an attacker to execute arbitrary code.
| Rule | Severity | Likelihood | 
|---|
| Detectable | Repairable | Priority | Level | 
|---|---|---|---|
| ARR39-C | High | Probable | No | 
| No | 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 | 
 | 
Incorrect pointer scaling, Pointer access out of bounds, Possible misuse of sizeof
Implicit scaling in pointer arithmetic might be ignored
Pointer dereferenced outside its bounds
Use of sizeof operator can cause unintended results
| 
 | Checks for 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.
Related Guidelines
Key here (explains table format and definitions)
| Taxonomy | Taxonomy item | Relationship | 
|---|---|---|
| CERT C Secure Coding Standard | ARR30-C. Do not form or use out-of-bounds pointers or array subscripts | Prior to 2018-01-12: CERT: Unspecified Relationship | 
| CERT C Secure Coding Standard | ARR37-C. Do not add or subtract an integer to a pointer to a non-array object | Prior to 2018-01-12: CERT: Unspecified Relationship | 
| ISO/IEC TR 24772:2013 | Pointer Casting and Pointer Type | 
| Changes [HFC] | Prior to 2018-01-12: CERT: Unspecified Relationship | |
| ISO/IEC TR 24772:2013 | Pointer Arithmetic [RVG] | Prior to 2018-01-12: CERT: Unspecified Relationship | 
| MISRA C:2012 | Rule 18.1 (required) | Prior to 2018-01-12: CERT: Unspecified Relationship | 
| MISRA C:2012 | Rule 18.2 (required) | Prior to 2018-01-12: CERT: Unspecified Relationship | 
| MISRA C:2012 | Rule 18.3 (required) | Prior to 2018-01-12: CERT: Unspecified Relationship | 
| MISRA C:2012 | Rule 18.4 (advisory) | 
| Prior to 2018-01-12: CERT: Unspecified Relationship | ||
| CWE 2.11 | CWE-468, Incorrect Pointer Scaling | 2017-07-07: CERT: Exact | 
Bibliography
| [Dowd 2006] | Chapter 6, "C Language Issues" | 
| [Murenin 07] | 
...
...