What changed, and why it matters
This is a one-line change that initializes two local variables to zero to silence a compiler warning. It does not alter program logic or fix a security bug.
No security action needed; treat as routine code quality/cleanup.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit changes the declaration of two uint64_t local variables in wallet2::unlocked_balance_all() from uninitialized to zero-initialized. The variables are only used when their corresponding output pointers (blocks_to_unlock and time_to_unlock) are non-null, in which case they are passed to unlocked_balance() which writes to them. Therefore, the uninitialized values were never read. The change merely suppresses a compiler warning and has no functional or security effect.
Changed components
src/wallet/wallet2.cppInspect captured patch +1 / −1
diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp
index 19ba991..244b364 100644
--- a/src/wallet/wallet2.cpp
+++ b/src/wallet/wallet2.cpp
@@ -7165,7 +7165,7 @@ uint64_t wallet2::unlocked_balance_all(bool strict, uint64_t *blocks_to_unlock,
*time_to_unlock = 0;
for (uint32_t index_major = 0; index_major < get_num_subaddress_accounts(); ++index_major)
{
- uint64_t local_blocks_to_unlock, local_time_to_unlock;
+ uint64_t local_blocks_to_unlock = 0, local_time_to_unlock = 0;
r += unlocked_balance(index_major, strict, blocks_to_unlock ? &local_blocks_to_unlock : NULL, time_to_unlock ? &local_time_to_unlock : NULL);
if (blocks_to_unlock)
*blocks_to_unlock = std::max(*blocks_to_unlock, local_blocks_to_unlock);
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.