CWE•Base•Draft•3 recent CVEs
CWE-395Use of NullPointerException Catch to Detect NULL Pointer Dereference
Description
Catching NullPointerException should not be used as an alternative to programmatic checks to prevent dereferencing a null pointer.
[object Object]
Common consequences
- Availability→DoS: Resource Consumption (CPU)
Potential mitigations
- Architecture and Design,ImplementationDo not extensively rely on catching exceptions (especially for validating user input) to handle errors. Handling exceptions can decrease the performance of an application.