aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/wallet_rpc_server.cpp
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2017-12-11 22:36:58 +0000
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2017-12-18 15:15:40 +0000
commit45a1c4c0885584554668c89bd6976474af01e2f5 (patch)
tree1e43812b37e0f2c2cb967f52133e0ddb09fbb61e /src/wallet/wallet_rpc_server.cpp
parenttests: fix a buffer overread in a unit test (diff)
downloadmonero-45a1c4c0885584554668c89bd6976474af01e2f5.tar.xz
add empty container sanity checks when using front() and back()
Diffstat (limited to '')
-rw-r--r--src/wallet/wallet_rpc_server.cpp7
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)
{