CWE-1071: Empty Code Block

BaseIncomplete

The source code contains a block that does not contain any code, i.e., the block is empty.

View on MITRE
Back to CWE Lookup

Extended Description

Empty code blocks can occur in the bodies of conditionals, function or method definitions, exception handlers, etc. While an empty code block might be intentional, it might also indicate incomplete implementation, accidental code deletion, unexpected macro expansion, etc. For some programming languages and constructs, an empty block might be allowed by the syntax, but the lack of any behavior within the block might violate a convention or API in such a way that it is an error.

Technical Details

Structure
Simple

Applicable To

Languages
Platforms

Frequently Asked Questions

What is CWE-1071: Empty Code Block?+

CWE-1071: Empty Code Block is a Common Weakness Enumeration (CWE) entry maintained by MITRE. The source code contains a block that does not contain any code, i.e., the block is empty. Empty code blocks can occur in the bodies of conditionals, function or method definitions, exception handlers, etc. While an empty code block might be intentional, it might also indicate incomplete implementation, accidental code deletion, unexpected macro expansion, etc. For some programming languages and constructs, an empty block might be allowed by the syntax, but the lack of any behavior within the block might violate a convention or API in such a way that it is an error.

What are the security consequences of Empty Code Block?+

If exploited, CWE-1071 (Empty Code Block) it can compromise Other, leading to outcomes such as Reduce Reliability.

What is the difference between a CWE and a CVE?+

A CWE (Common Weakness Enumeration) like CWE-1071 describes a category of software weakness — the underlying flaw type. A CVE (Common Vulnerabilities and Exposures) identifies a specific, real-world vulnerability in a particular product. In short, a CWE is the kind of mistake, and a CVE is an instance of that mistake being found in software.

Learn More

CWE-1071: Empty Code Block | CWE Lookup | InventiveHQ