CWE-563 · Słabość
Assignment to Variable without Use
- Abstrakcja
- Bazowa
- Status
- Szkic
- Dodano
- 19 lipca 2006
- Ostatnia zmiana
- 11 grudnia 2025
Opis
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.
Inne nazwy
- Unused Variable
Skutki
Other
Quality Degradation; Varies by Context
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.
Zapobieganie
Implementation
Remove unused variables from the code.
Słabość nadrzędna
Kiedy powstaje
- Implementation
Dotyczy
Not Language-Specific
Wpis z katalogu CWE 4.20.