aboutsummaryrefslogtreecommitdiff
path: root/src/cryptonote_basic/cryptonote_format_utils.cpp
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2018-07-24 21:32:49 +0100
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2018-09-11 13:38:15 +0000
commitd1591853bf0df9a278420e874b7d8dd03966b66d (patch)
tree404fa9126ce6d524a4e921b6a0168a91667f8f31 /src/cryptonote_basic/cryptonote_format_utils.cpp
parentringct: prevent a potential very large allocation (diff)
downloadmonero-d1591853bf0df9a278420e874b7d8dd03966b66d.tar.xz
cryptonote_basic: check output type before using it
Reported by QuarksLab.
Diffstat (limited to 'src/cryptonote_basic/cryptonote_format_utils.cpp')
-rw-r--r--src/cryptonote_basic/cryptonote_format_utils.cpp7
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)
{