...
Exception handlers with inverted priorities cause unexpected control flow when an exception of the derived type occurs.
Rule | Severity | Likelihood | Detectable | RepairableRemediation Cost | Priority | Level |
|---|---|---|---|---|---|---|
ERR54-CPP | Medium | Likely | Yes | YesLow | P18 | L1 |
Automated Detection
Tool | Version | Checker | Description | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Astrée |
| exception-caught-by-earlier-handler | Fully checked | ||||||||||||
| Axivion Bauhaus Suite |
| CertC++-ERR54 | |||||||||||||
| Clang |
| -Wexceptions | |||||||||||||
| CodeSonar |
| LANG.STRUCT.UCTCH | Masked by handler | ||||||||||||
| CP1.ERR36 | Fully implemented | |||||||||||||
| Helix QAC |
| C++4030, C++4639 | |||||||||||||
| Klocwork |
| MISRA.CATCH.NOALL MISRA.CATCH.WRONGORD | |||||||||||||
| LDRA tool suite |
| 541 S, 556 S | Fully implemented | ||||||||||||
| Parasoft C/C++test |
| EXCEPT-17 | PRQA QA-C++ | ||||||||||||
| Include Page | PRQA QA-C++_V | PRQA QA-C++_V | 4030, 4639 | CERT_CPP-ERR54-a | Where multiple handlers are provided in a single try-catch statement or function-try-block for a derived class and some or all of its bases, the handlers shall be ordered most-derived to base class | ||||||||||
| Polyspace Bug Finder |
| CERT C++: ERR54-CPP | Checks for:
Rule fully covered. | ||||||||||||
| PVS-Studio |
| V759 | |||||||||||||
| RuleChecker |
| exception-caught-by-earlier-handler | Fully checked | PVS-Studio | 6.22 | V759||||||||||
| SonarQube C/C++ Plugin |
| S1045 |
Related Vulnerabilities
Search for other vulnerabilities resulting from the violation of this rule on the CERT website.
...