...
Code Block | ||
---|---|---|
| ||
public class StackUnderflowException extends Exception { StackUnderflowException () { super(); } StackUnderflowException (String msg) { super(msg); } } // ... try { doSomething(); } catch(StackUnderflowException sue) { // ... } catch(TimeoutException te) { // ... } catch(SecurityException se) { // ... } catch(Exception e) { // ... throw e; } |
...
Applicability
Exceptions are used to handle exceptional conditions. If an exception is not caught, the program will be terminated. An exception that is incorrectly caught or is caught at the wrong level of recovery will likely cause incorrect behavior.
Guideline | Severity | Likelihood | Remediation Cost | Priority | Level |
---|---|---|---|---|---|
ERR51-JG | low | probable | medium | P4 | L3 |
Automated Detection
Automated detection is not feasible.
Related Vulnerabilities
C++ Secure Coding Standard: ERR08-CPP. Prefer special-purpose types for exceptions