...
It is difficult to pinpoint violations of this recommendation because static analysis tools are currently unable to identify code that can lead to heap exhaustion. The heap size also varies for different runtime environments.
Rule | Severity | Likelihood | Remediation Cost | Priority | Level |
---|---|---|---|---|---|
MEM11-C | Low | Probable | High | P2 | L3 |
Automated Detection
Tool | Version | Checker | Description | ||||||
---|---|---|---|---|---|---|---|---|---|
CodeSonar |
| ALLOC.LEAK | Leak | ||||||
LDRA tool suite |
| 26 S, 140 S, 6 D, 28 D, 5 C, 1 U | Partially implemented | ||||||
Polyspace Bug Finder |
| Memory allocation with tainted size | Memory allocated dynamically not freed Size argument to memory function is from an unsecure source Value from an unsecure source changes sign Pointer returned from dynamic allocation not checked for |
Related Vulnerabilities
Search for vulnerabilities resulting from the violation of this rule on the CERT website.
Related Guidelines
SEI CERT C++ Coding Standard | VOID MEM12-CPP. Do not assume infinite heap space |
CERT Oracle Secure Coding Standard for Java | MSC05-J. Do not exhaust heap space |
MITRE CWE | CWE-770, Allocation of resources without limits or throttling |
...
...