CWE-482 - Comparing instead of Assigning
- Abstraction:Variant
- Structure:Simple
- Status:Draft
- Release Date:2006-07-19
- Latest Modification Date:2023-06-29
Weakness Name
Comparing instead of Assigning
Description
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.
Common Consequences
Scope: Availability, Integrity
Impact: Unexpected State
Notes: The assignment will not take place, which should cause obvious program execution problems.