mirror of
https://git.wownero.com/wownero/wownero.git
synced 2024-08-15 01:03:23 +00:00
fix a couple bugs found by OSS-fuzz
- index out of bounds when importing outputs - accessing invalid CLSAG data
This commit is contained in:
parent
d27d4526fe
commit
9e6187a736
2 changed files with 8 additions and 0 deletions
|
@ -368,6 +368,12 @@ namespace rct {
|
||||||
template<bool W, template <bool> class Archive>
|
template<bool W, template <bool> class Archive>
|
||||||
bool serialize_rctsig_prunable(Archive<W> &ar, uint8_t type, size_t inputs, size_t outputs, size_t mixin)
|
bool serialize_rctsig_prunable(Archive<W> &ar, uint8_t type, size_t inputs, size_t outputs, size_t mixin)
|
||||||
{
|
{
|
||||||
|
if (inputs >= 0xffffffff)
|
||||||
|
return false;
|
||||||
|
if (outputs >= 0xffffffff)
|
||||||
|
return false;
|
||||||
|
if (mixin >= 0xffffffff)
|
||||||
|
return false;
|
||||||
if (type == RCTTypeNull)
|
if (type == RCTTypeNull)
|
||||||
return ar.stream().good();
|
return ar.stream().good();
|
||||||
if (type != RCTTypeFull && type != RCTTypeSimple && type != RCTTypeBulletproof && type != RCTTypeBulletproof2 && type != RCTTypeCLSAG)
|
if (type != RCTTypeFull && type != RCTTypeSimple && type != RCTTypeBulletproof && type != RCTTypeBulletproof2 && type != RCTTypeCLSAG)
|
||||||
|
|
|
@ -13043,6 +13043,8 @@ process:
|
||||||
crypto::public_key tx_pub_key = get_tx_pub_key_from_received_outs(td);
|
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);
|
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),
|
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");
|
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;
|
const crypto::public_key& out_key = boost::get<cryptonote::txout_to_key>(td.m_tx.vout[td.m_internal_output_index].target).key;
|
||||||
|
|
Loading…
Reference in a new issue