...
Using an invalid reference, pointer, or iterator to a string object could allow an attacker to run arbitrary code.
Rule | Severity | Likelihood |
|---|
Detectable | Repairable | Priority | Level |
|---|---|---|---|
STR52-CPP | High | Probable | No |
No | P6 | L2 |
Automated Detection
Tool | Version | Checker | Description |
|---|
| CodeSonar |
| ALLOC.UAF | Use After Free | ||||||
| Helix QAC |
| DF4746, DF4747, DF4748, DF4749 | |||||||
| Parasoft C/C++test |
| CERT_CPP-STR52-a | Use valid references, pointers, and iterators to reference elements of a basic_string | ||||||
| Polyspace Bug Finder |
| CERT C++: STR52-CPP | Checks for use of invalid string iterator (rule partially covered). | ||||||
| Security Reviewer - Static Reviewer | 6.02 | C24 | Fully implemented |
Related Vulnerabilities
Search for vulnerabilities resulting from the violation of this rule on the CERT website.
Related Guidelines
| SEI CERT C++ Coding Standard | CTR51-CPP. Use valid references, pointers, and iterators to reference elements of a container |
Bibliography
| [ISO/IEC 14882-2014] | Subclause 21.4.1, " |
| [Meyers |
| 2001] | Item 43, "Prefer Algorithm Calls to Hand-written Loops" |
...
...