Skip to content

Latest commit

 

History

History
16 lines (11 loc) · 993 Bytes

SWC-109.md

File metadata and controls

16 lines (11 loc) · 993 Bytes

Title

Uninitialized Storage Pointer

Relationships

CWE-824: Access of Uninitialized Pointer

Description

Uninitialized local storage variables can point to unexpected storage locations in the contract, which can lead to intentional or unintentional vulnerabilities.

Remediation

Check if the contract requires a storage object as in many situations this is actually not the case. If a local variable is sufficient mark the storage location of the variable explicitly with the memory attribute. If a storage variable is needed then initialise is upon declaration and additionally specific the storage location storage.

Note: As of compiler version 0.5.0 and higher this issue has been systematically resolved as contracts with uninitialised storage pointers do no longer compile.

References