CWE DATABASE
About
GET A DEMO
Backslash Vulnerability Database
Comparing instead of Assigning
Comparing instead of Assigning
CWE-482
Short description
The code uses an operator for comparison when the intention was to perform an assignment.
Extended description
In many languages, the compare statement is very close in appearance to the assignment statement; they are often confused.
Best practices to prevent this CWE
Phase: Testing
Many IDEs and static analysis products will detect this problem.