VariantDraft

CWE-482Comparing instead of Assigning

Category: other

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· 1

  • Availability / Integrity — Unexpected State
    The assignment will not take place, which should cause obvious program execution problems.

Potential mitigations· 1

  • [Testing]Many IDEs and static analysis products will detect this problem.

References

  1. https://cwe.mitre.org/data/definitions/482.html

(incoming)1

TypeTargetConfidenceTier
VulnerabilityCVE-2026-26279cve-2026-262790%live

Related by meaning· 6

Nearest entities by semantic similarity across the cs-graph corpus.

CWE
Assigning instead of Comparing
CWE
Floating Point Comparison with Incorrect Operator
CWE
Assignment to Variable without Use
CWE
Excessive Use of Unconditional Branching
CWE
Use of Same Variable for Multiple Purposes
CWE
Insufficient Control Flow Management
Sourced from MITRE CWE 4.20. Curated for EU compliance use cases by Adam Lundqvist, Founder at SQUR.