cryptonote_basic: check output type before using it

Reported by QuarksLab.
This commit is contained in:
moneromooo-monero 2018-07-24 21:32:49 +01:00
parent 61632dc166
commit d1591853bf
No known key found for this signature in database
GPG key ID: 686F07454D6CEFC3

View file

@ -135,7 +135,14 @@ namespace cryptonote
return false; return false;
} }
for (size_t n = 0; n < tx.rct_signatures.outPk.size(); ++n) 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); rv.outPk[n].dest = rct::pk2rct(boost::get<txout_to_key>(tx.vout[n].target).key);
}
if (!base_only) if (!base_only)
{ {