diff options
author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2018-07-24 21:32:49 +0100 |
---|---|---|
committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2018-09-11 13:38:15 +0000 |
commit | d1591853bf0df9a278420e874b7d8dd03966b66d (patch) | |
tree | 404fa9126ce6d524a4e921b6a0168a91667f8f31 /src/cryptonote_basic | |
parent | ringct: prevent a potential very large allocation (diff) | |
download | monero-d1591853bf0df9a278420e874b7d8dd03966b66d.tar.xz |
cryptonote_basic: check output type before using it
Reported by QuarksLab.
Diffstat (limited to 'src/cryptonote_basic')
-rw-r--r-- | src/cryptonote_basic/cryptonote_format_utils.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/cryptonote_basic/cryptonote_format_utils.cpp b/src/cryptonote_basic/cryptonote_format_utils.cpp index f1a5c4d94..9061bf105 100644 --- a/src/cryptonote_basic/cryptonote_format_utils.cpp +++ b/src/cryptonote_basic/cryptonote_format_utils.cpp @@ -135,7 +135,14 @@ namespace cryptonote return false; } for (size_t n = 0; n < tx.rct_signatures.outPk.size(); ++n) + { + if (tx.vout[n].target.type() != typeid(txout_to_key)) + { + LOG_PRINT_L1("Unsupported output type in tx " << get_transaction_hash(tx)); + return false; + } rv.outPk[n].dest = rct::pk2rct(boost::get<txout_to_key>(tx.vout[n].target).key); + } if (!base_only) { |