diff options
| author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2017-12-12 11:08:11 +0000 |
|---|---|---|
| committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2017-12-18 15:15:49 +0000 |
| commit | b49ddc766de47b40aa705a0a0c0bb901c743908d (patch) | |
| tree | edac56cb5d089c91a98164126b295b4cd6334b4d /src/cryptonote_core/cryptonote_tx_utils.cpp | |
| parent | 2305bf260d852135fab53a0a2e95dce8994d7afc (diff) | |
| download | monzero-core-b49ddc766de47b40aa705a0a0c0bb901c743908d.tar.gz monzero-core-b49ddc766de47b40aa705a0a0c0bb901c743908d.tar.xz monzero-core-b49ddc766de47b40aa705a0a0c0bb901c743908d.zip | |
check accessing an element past the end of a container
Diffstat (limited to 'src/cryptonote_core/cryptonote_tx_utils.cpp')
| -rw-r--r-- | src/cryptonote_core/cryptonote_tx_utils.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/cryptonote_core/cryptonote_tx_utils.cpp b/src/cryptonote_core/cryptonote_tx_utils.cpp index 89f24a4d4..916b1e05a 100644 --- a/src/cryptonote_core/cryptonote_tx_utils.cpp +++ b/src/cryptonote_core/cryptonote_tx_utils.cpp @@ -190,6 +190,12 @@ namespace cryptonote //--------------------------------------------------------------- bool construct_tx_with_tx_key(const account_keys& sender_account_keys, const std::unordered_map<crypto::public_key, subaddress_index>& subaddresses, std::vector<tx_source_entry>& sources, const std::vector<tx_destination_entry>& destinations, const boost::optional<cryptonote::account_public_address>& change_addr, std::vector<uint8_t> extra, transaction& tx, uint64_t unlock_time, const crypto::secret_key &tx_key, const std::vector<crypto::secret_key> &additional_tx_keys, bool rct, bool bulletproof, rct::multisig_out *msout) { + if (sources.empty()) + { + LOG_ERROR("Empty sources"); + return false; + } + std::vector<rct::key> amount_keys; tx.set_null(); amount_keys.clear(); |
