168 – Initialize variables explicitly
Summary
All the variables in the source code must be explicitly initialized.
Description
Uninitialized variables can lead to undefined behavior, unpredictable outcomes, and potential security vulnerabilities. Explicit initialization helps to mitigate the risk of using variables before they have been assigned with a valid value, reducing the likelihood of bugs and vulnerabilities, such as buffer overflows or memory corruption.
Supported In
Advanced: True
References
- CWE-456. Missing initialization of a variable
- CWE-457. Use of uninitialized variable
- CERTC-EXP33-C. Do not read uninitialized memory
- MITRE-M1013. Application developer guidance
- ISO27002-8_28. Secure coding
- NISTSSDF-PW_5_1. Archive and protect each software release
- OSAMM-ST. Security Testing
- C2M2-9_4_d. Implement software security for cybersecurity architecture
- ISO27001-8_28. Secure coding
Weaknesses
Last updated
2024/02/09