diff options
author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2017-09-10 12:32:46 +0100 |
---|---|---|
committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2017-09-25 15:48:48 +0100 |
commit | fee15ef1a9d1b726ce1be0a8661d93445cc1035c (patch) | |
tree | 0105e356872dc8dd06870a4972e0761ec4b8bc9b /src/wallet/wallet2.cpp | |
parent | net_peerlist: remove dead code (diff) | |
download | monero-fee15ef1a9d1b726ce1be0a8661d93445cc1035c.tar.xz |
wallet2: catch failure to parse address
CID 175297
Diffstat (limited to 'src/wallet/wallet2.cpp')
-rw-r--r-- | src/wallet/wallet2.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp index 38d1bcb44..986f33073 100644 --- a/src/wallet/wallet2.cpp +++ b/src/wallet/wallet2.cpp @@ -383,7 +383,11 @@ std::unique_ptr<tools::wallet2> generate_from_json(const std::string& json_file, cryptonote::account_public_address address2; bool has_payment_id; crypto::hash8 new_payment_id; - get_account_integrated_address_from_str(address2, has_payment_id, new_payment_id, testnet, field_address); + if (!get_account_integrated_address_from_str(address2, has_payment_id, new_payment_id, testnet, field_address)) + { + tools::fail_msg_writer() << tools::wallet2::tr("failed to parse address: ") << field_address; + return false; + } address.m_spend_public_key = address2.m_spend_public_key; } wallet->generate(field_filename, field_password, address, viewkey); |