Umbra Wiki weakness weakness/CWE-585
Back to wiki

CWE-585 — Empty Synchronized Block

provenance: imported · CWE: CWE-585

CWE-585: Empty Synchronized Block

MITRE CWE weakness

Kind Weakness
Abstraction Variant
Status Draft
Likelihood of exploit

Description

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.

Common consequences

  • Other: Other

Mitigations

Implementation — When you come across an empty synchronized statement, or a synchronized statement in which the code has been commented out, try to determine what the original intentions were and whether or not the synchronized block is still necessary.

References

  • CWE page: https://cwe.mitre.org/data/definitions/585.html
  • CWE list: https://cwe.mitre.org/data/index.html