The variable's value is assigned but never used, making it a dead store.
View on MITREAfter the assignment, the variable is either assigned another value or goes out of scope. It is likely that the variable is simply vestigial, but it is also possible that the unused variable points out a bug.
This weakness could be an indication of a bug in the program or a deprecated variable that was not removed and is an indication of poor quality. This could lead to further bugs and the introduction of weaknesses.
Remove unused variables from the code.
No detection method information available for this CWE.
The following code excerpt assigns to the variable r and then overwrites the value without using it.
No relationship information available for this CWE.
CWE-563: Assignment to Variable without Use is a Common Weakness Enumeration (CWE) entry maintained by MITRE. The variable's value is assigned but never used, making it a dead store. After the assignment, the variable is either assigned another value or goes out of scope. It is likely that the variable is simply vestigial, but it is also possible that the unused variable points out a bug.
If exploited, CWE-563 (Assignment to Variable without Use) it can compromise Other, leading to outcomes such as Quality Degradation and Varies by Context.
Recommended mitigations for CWE-563 include: Remove unused variables from the code.
A CWE (Common Weakness Enumeration) like CWE-563 describes a category of software weakness — the underlying flaw type. A CVE (Common Vulnerabilities and Exposures) identifies a specific, real-world vulnerability in a particular product. In short, a CWE is the kind of mistake, and a CVE is an instance of that mistake being found in software.