diff options
author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2017-12-11 22:36:58 +0000 |
---|---|---|
committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2017-12-18 15:15:40 +0000 |
commit | 45a1c4c0885584554668c89bd6976474af01e2f5 (patch) | |
tree | 1e43812b37e0f2c2cb967f52133e0ddb09fbb61e /src/wallet/wallet_rpc_server.cpp | |
parent | tests: fix a buffer overread in a unit test (diff) | |
download | monero-45a1c4c0885584554668c89bd6976474af01e2f5.tar.xz |
add empty container sanity checks when using front() and back()
Diffstat (limited to '')
-rw-r--r-- | src/wallet/wallet_rpc_server.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/wallet/wallet_rpc_server.cpp b/src/wallet/wallet_rpc_server.cpp index 0482b9dd6..baf8086f8 100644 --- a/src/wallet/wallet_rpc_server.cpp +++ b/src/wallet/wallet_rpc_server.cpp @@ -602,6 +602,13 @@ namespace tools uint64_t mixin = m_wallet->adjust_mixin(req.mixin); std::vector<wallet2::pending_tx> ptx_vector = m_wallet->create_transactions_2(dsts, mixin, req.unlock_time, req.priority, extra, req.account_index, req.subaddr_indices, m_trusted_daemon); + if (ptx_vector.empty()) + { + er.code = WALLET_RPC_ERROR_CODE_TX_NOT_POSSIBLE; + er.message = "No transaction created"; + return false; + } + // reject proposed transactions if there are more than one. see on_transfer_split below. if (ptx_vector.size() != 1) { |