From 5122f2cfc6556aea9b0dcac6f1189d4ae4a3509a Mon Sep 17 00:00:00 2001 From: woodser <13068859+woodser@users.noreply.github.com> Date: Mon, 2 Nov 2026 08:21:03 -0500 Subject: [PATCH] wallet: fix out of bounds read of subaddress num_blocks_to_unlock get_subaddresses_aux checked the balance map but dereferenced the unlocked balance map, which has no entry when a subaddress only holds pool funds. --- src/wallet/monero_wallet_full.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wallet/monero_wallet_full.cpp b/src/wallet/monero_wallet_full.cpp index 1ea97ba5..be31e18a 100644 --- a/src/wallet/monero_wallet_full.cpp +++ b/src/wallet/monero_wallet_full.cpp @@ -3957,7 +3957,7 @@ namespace monero { cryptonote::subaddress_index index = {account_idx, subaddress_idx}; subaddress.m_num_unspent_outputs = count_if(transfers.begin(), transfers.end(), [&](const tools::wallet2::transfer_details& td) { return !td.m_spent && td.m_subaddr_index == index; }); subaddress.m_is_used = find_if(transfers.begin(), transfers.end(), [&](const tools::wallet2::transfer_details& td) { return td.m_subaddr_index == index; }) != transfers.end(); - subaddress.m_num_blocks_to_unlock = iter1 == balance_per_subaddress.end() ? 0 : iter2->second.second.first; + subaddress.m_num_blocks_to_unlock = iter2 == unlocked_balance_per_subaddress.end() ? 0 : iter2->second.second.first; subaddresses.push_back(subaddress); }