CWE-595Comparison of Object References Instead of Object Contents

PUBLISHEDweakness record
released 2006-12-15 · last modified 2025-12-11

Metadata

CWE ID:
CWE-595
摘要:
Variant
结构:
Simple
状态:
Incomplete
发布日期:
2006-12-15
更新日期:
2025-12-11

名称

Comparison of Object References Instead of Object Contents

描述

The product compares object references instead of the contents of the objects themselves, preventing it from detecting equivalent objects.

For example, in Java, comparing objects using == usually produces deceptive results, since the == operator compares object references rather than values; often, this means that using == for strings is actually comparing the strings' references, not their values.

常见后果

范围:
Other
影响:
Varies by Context
注释:
This weakness can lead to erroneous results that can cause unexpected application behaviors.

相关 CWE