CWE-365: DEPRECATED: Race Condition in Switch
This entry has been deprecated. There are no documented cases in which a switch's control expression is evaluated more than once.
Last updated
Overview
It is likely that this entry was initially created based on a misinterpretation of the original source material. The original source intended to explain how switches could be unpredictable when using threads, if the control expressions used data or variables that could change between execution of different threads. That weakness is already covered by CWE-367. Despite the ambiguity in the documentation for some languages and compilers, in practice, they all evaluate the switch control expression only once. If future languages state that the code explicitly evaluates the control expression more than once, then this would not be a weakness, but the language performing as designed.
Frequently asked questions
Common questions about CWE-365.
- What is CWE-365?
- This entry has been deprecated. There are no documented cases in which a switch's control expression is evaluated more than once.
References
- MITRE CWE definition (CWE-365) (opens in a new tab)
- CWE-365 vulnerabilities on NVD (opens in a new tab)
- Learn: What is a CWE?
Weakness data is sourced from the MITRE CWE catalog (v4.20). CVE associations are aggregated and kept current by RadicalNotion.AI.
Stay ahead of CWE-365
Get alerted the moment a new CWE-365 vulnerability affects your stack, with AI-written analysis, severity context, and remediation guidance.