CWE-482Comparing instead of Assigning

PUBLISHEDweakness recordLow
released 2006-07-19 · last modified 2026-04-30

Metadata

CWE ID:
CWE-482
摘要:
Variant
结构:
Simple
状态:
Draft
发布日期:
2006-07-19
更新日期:
2026-04-30

名称

Comparing instead of Assigning

描述

The code uses an operator for comparison when the intention was to perform an assignment.

In many languages, the compare statement is very close in appearance to the assignment statement; they are often confused.

常见后果

范围:
Availability, Integrity
影响:
Unexpected State
注释:
The assignment will not take place, which should cause obvious program execution problems.

相关 CWE