CWE-395Use of NullPointerException Catch to Detect NULL Pointer Dereference

PUBLISHEDweakness record
released 2006-07-19 · last modified 2025-12-11

Metadata

CWE ID:
CWE-395
摘要:
Base
结构:
Simple
状态:
Draft
发布日期:
2006-07-19
更新日期:
2025-12-11

名称

Use of NullPointerException Catch to Detect NULL Pointer Dereference

描述

Catching NullPointerException should not be used as an alternative to programmatic checks to prevent dereferencing a null pointer.

Programmers typically catch NullPointerException under three circumstances: Of these three circumstances, only the last is acceptable.

常见后果

范围:
Availability
影响:
DoS: Resource Consumption (CPU)

相关 CWE