diff options
author | stoffu <stoffu@protonmail.ch> | 2018-06-21 10:49:03 +0900 |
---|---|---|
committer | stoffu <stoffu@protonmail.ch> | 2018-06-21 10:49:03 +0900 |
commit | 66df13a58b6ede4b38aebede4b9a2ea08e161efe (patch) | |
tree | 21d1343b737c6c7fa400edc088eb14852207d747 /src | |
parent | Merge pull request #3878 (diff) | |
download | monero-66df13a58b6ede4b38aebede4b9a2ea08e161efe.tar.xz |
wallet-rpc.getaddress: throw if index is out of bound
Diffstat (limited to 'src')
-rw-r--r-- | src/wallet/wallet_rpc_server.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/wallet/wallet_rpc_server.cpp b/src/wallet/wallet_rpc_server.cpp index 7f7d33642..9b2dda3eb 100644 --- a/src/wallet/wallet_rpc_server.cpp +++ b/src/wallet/wallet_rpc_server.cpp @@ -362,6 +362,7 @@ namespace tools if (!m_wallet) return not_open(er); try { + THROW_WALLET_EXCEPTION_IF(req.account_index >= m_wallet->get_num_subaddress_accounts(), error::account_index_outofbound); res.addresses.clear(); std::vector<uint32_t> req_address_index; if (req.address_index.empty()) @@ -377,6 +378,7 @@ namespace tools m_wallet->get_transfers(transfers); for (uint32_t i : req_address_index) { + THROW_WALLET_EXCEPTION_IF(i >= m_wallet->get_num_subaddresses(req.account_index), error::address_index_outofbound); res.addresses.resize(res.addresses.size() + 1); auto& info = res.addresses.back(); const cryptonote::subaddress_index index = {req.account_index, i}; |