...
Attempting to throw exceptions from destructors or deallocation functions can result in undefined behavior, leading to resource leaks or denial-of-service attacks.
Rule | Severity | Likelihood | Remediation Cost | Priority | Level |
---|---|---|---|---|---|
DCL57-CPP | Low | Likely | Medium | P6 | L2 |
Automated Detection
Tool | Version | Checker | Description | ||||||
---|---|---|---|---|---|---|---|---|---|
LDRA tool suite |
| 453 S | Partially implemented | ||||||
PVS-Studio | 6.22 | V509 | General analysis rule |
Related Vulnerabilities
Search for vulnerabilities resulting from the violation of this rule on the CERT website.
Related Guidelines
SEI CERT C++ Coding Standard | ERR55-CPP. Honor exception specifications ERR50-CPP. Do not abruptly terminate the program |
MISRA C++:2008 | Rule 15-5-1 (Required) |
Bibliography
[Henricson 1997] | Recommendation 12.5, Do not let destructors called during stack unwinding throw exceptions |
[ISO/IEC 14882-2014] | Subclause 3.4.7.2, "Deallocation Functions" |
[Meyers 2005] | Item 8, "Prevent Exceptions from Leaving Destructors" |
[Sutter 2000] | "Never allow exceptions from escaping destructors or from an overloaded operator delete() " (p. 29) |
...
...