From f6da25a32e944b028b7d9c2e4a0769543d5ba19e Mon Sep 17 00:00:00 2001 From: moneromooo-monero Date: Tue, 16 Jun 2015 15:35:55 +0100 Subject: Fix standard address deserialization --- src/cryptonote_core/cryptonote_basic_impl.cpp | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/src/cryptonote_core/cryptonote_basic_impl.cpp b/src/cryptonote_core/cryptonote_basic_impl.cpp index 839c6ad1e..abdef64f9 100644 --- a/src/cryptonote_core/cryptonote_basic_impl.cpp +++ b/src/cryptonote_core/cryptonote_basic_impl.cpp @@ -205,15 +205,25 @@ namespace cryptonote { return false; } - integrated_address iadr; - if (!::serialization::parse_binary(data, iadr)) + if (has_payment_id) { - LOG_PRINT_L1("Account public address keys can't be parsed"); - return false; + integrated_address iadr; + if (!::serialization::parse_binary(data, iadr)) + { + LOG_PRINT_L1("Account public address keys can't be parsed"); + return false; + } + adr = iadr.adr; + payment_id = iadr.payment_id; + } + else + { + if (!::serialization::parse_binary(data, adr)) + { + LOG_PRINT_L1("Account public address keys can't be parsed"); + return false; + } } - - adr = iadr.adr; - payment_id = iadr.payment_id; if (!crypto::check_key(adr.m_spend_public_key) || !crypto::check_key(adr.m_view_public_key)) { -- cgit v1.2.3