...
Object slicing can result in abnormal program execution. This generally is not a problem for exceptions, but it can lead to unexpected behavior depending on the assumptions made by the exception handler.
Rule | Severity | Likelihood | Remediation Cost | Priority | Level |
---|---|---|---|---|---|
ERR61-CPP | Low | Unlikely | Low | P3 | L3 |
Automated Detection
Tool | Version | Checker | Description | ||||||
---|---|---|---|---|---|---|---|---|---|
|
| Checked by clang-tidy ; also checks for VOID ERR09-CPP. Throw anonymous temporaries by default | |||||||
SonarQube C/C++ Plugin |
| S1044 |
LDRA tool suite |
| 455 S | Fully implemented |
PRQA QA-C++ | 4.1 | 4031 |
PVS-Studio | 6.22 | V746 | General analysis rule |
Related Vulnerabilities
Search for other vulnerabilities resulting from the violation of this rule on the CERT website.
...
This rule is a subset of OOP51-CPP. Do not slice derived objects.
Bibliography
[ISO/IEC 14882-2014] | Subclause 3.9, "Types" |
[MISRA 2008] | Rule 15-3-5 |
...
...