aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/wallet2.cpp
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2020-09-24 15:16:44 +0000
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2020-09-24 15:30:38 +0000
commitb6c4f8cd545a033859d3f7e91949f4883b856ed6 (patch)
tree9c764c244a29fc2019d6ca0ab8a78227bcba220a /src/wallet/wallet2.cpp
parentMerge pull request #6819 (diff)
downloadmonero-b6c4f8cd545a033859d3f7e91949f4883b856ed6.tar.xz
fix a couple bugs found by OSS-fuzz
- index out of bounds when importing outputs - accessing invalid CLSAG data
Diffstat (limited to '')
-rw-r--r--src/wallet/wallet2.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp
index 063c493ce..a3755ff08 100644
--- a/src/wallet/wallet2.cpp
+++ b/src/wallet/wallet2.cpp
@@ -13043,6 +13043,8 @@ process:
crypto::public_key tx_pub_key = get_tx_pub_key_from_received_outs(td);
const std::vector<crypto::public_key> additional_tx_pub_keys = get_additional_tx_pub_keys_from_extra(td.m_tx);
+ THROW_WALLET_EXCEPTION_IF(td.m_internal_output_index >= td.m_tx.vout.size(),
+ error::wallet_internal_error, "Internal index is out of range");
THROW_WALLET_EXCEPTION_IF(td.m_tx.vout[td.m_internal_output_index].target.type() != typeid(cryptonote::txout_to_key),
error::wallet_internal_error, "Unsupported output type");
const crypto::public_key& out_key = boost::get<cryptonote::txout_to_key>(td.m_tx.vout[td.m_internal_output_index].target).key;