CWE-585Empty Synchronized Block

PUBLISHEDweakness record
released 2006-12-15 · last modified 2025-04-03

Metadata

CWE ID:
CWE-585
摘要:
Variant
结构:
Simple
状态:
Draft
发布日期:
2006-12-15
更新日期:
2025-04-03

名称

Empty Synchronized Block

描述

The product contains an empty synchronized block.

An empty synchronized block does not actually accomplish any synchronization and may indicate a troubled section of code. An empty synchronized block can occur because code no longer needed within the synchronized block is commented out without removing the synchronized block.

常见后果

范围:
Other
影响:
Other
注释:
An empty synchronized block will wait until nobody else is using the synchronizer being specified. While this may be part of the desired behavior, because you haven't protected the subsequent code by placing it inside the synchronized block, nothing is stopping somebody else from modifying whatever it was you were waiting for while you run the subsequent code.

相关 CWE