CWE-1126: Declaration of Variable with Unnecessarily Wide Scope
Filter
The source code declares a variable in one scope, but the variable is only used within a narrower scope.
What the weakness is: CWE-1126 at MITRE. All weaknesses
Ask an AI about CWE-1126
Show the prompt
Explain CWE-1126: Declaration of Variable with Unnecessarily Wide Scope and how to prevent and detect it in code. Use https://cwe.mitre.org/data/definitions/1126.html and https://cve.bz/cve/cwe/1126?via=ask-ai-copy for recent CVEs with this weakness. Cite the sources.Opens a third-party assistant; its answer is its own, not cve.bz's. The prompt holds only this weakness's id and public links.
No records match.