CWE-482βComparing instead of Assigning
PUBLISHEDweakness recordLow
released 2006-07-19 Β· last modified 2026-04-30
Metadata
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.