CWE一覧に戻る
CWE-365

削除しました:スイッチのレースコンディション

DEPRECATED: Race Condition in Switch
脆弱性 確定版
JA

この項目は非推奨となった。スイッチの制御式が複数回評価されるケースは、文書化されていません。

この項目は当初、原典の誤った解釈に基づいて作成された可能性が高い。元のソースは、スレッドを使用する際に、制御式が異なるスレッドの実行間で変更される可能性のあるデータや変数を使用する場合、スイッチが予測不可能になる可能性があることを説明することを意図していました。その弱点はすでにCWE-367でカバーされている。いくつかの言語やコンパイラのドキュメントには曖昧さがあるものの、実際には、それらはすべてスイッチ制御式を一度だけ評価します。もし将来の言語が、コードが明示的に制御式を複数回評価することを明記していれば、これは弱点ではなく、言語が設計通りに動作していることになります。

EN

This entry has been deprecated. There are no documented cases in which a switch's control expression is evaluated more than once.

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.

不明

MITRE公式ページ — CWE-365