CWE-908

Use of Uninitialized Resource

Medium

Description

The product uses or accesses a resource that has not been initialized.

Potential Impact

How to Fix

Implementation

Explicitly initialize the resource before use. If this is performed through an API function or standard procedure, follow all required steps.

Implementation

Pay close attention to complex conditionals that affect initialization, since some branches might not perform the initialization.

Implementation

Avoid race conditions (CWE-362) during initialization routines.

Build and Compilation

Run or compile the product with settings that generate warnings about uninitialized variables or data.

Detection Methods

Related Weaknesses

References

View on MITRE CWE Database →

Need Help Fixing This Vulnerability?

Our security experts can help you identify and remediate CWE-908 vulnerabilities in your codebase.

Get Security Assessment