mirror of
https://github.com/monero-project/monero.git
synced 2025-05-19 21:50:24 -04:00
simplewallet: validate hex input size
This commit is contained in:
parent
3f171b931f
commit
83ec209f42
5 changed files with 21 additions and 21 deletions
|
@ -182,7 +182,7 @@ bool WalletManagerImpl::checkPayment(const std::string &address_text, const std:
|
|||
{
|
||||
error = "";
|
||||
cryptonote::blobdata txid_data;
|
||||
if(!epee::string_tools::parse_hexstr_to_binbuff(txid_text, txid_data))
|
||||
if(!epee::string_tools::parse_hexstr_to_binbuff(txid_text, txid_data) || txid_data.size() != sizeof(crypto::hash))
|
||||
{
|
||||
error = tr("failed to parse txid");
|
||||
return false;
|
||||
|
@ -196,7 +196,7 @@ bool WalletManagerImpl::checkPayment(const std::string &address_text, const std:
|
|||
}
|
||||
crypto::secret_key tx_key;
|
||||
cryptonote::blobdata tx_key_data;
|
||||
if(!epee::string_tools::parse_hexstr_to_binbuff(txkey_text, tx_key_data))
|
||||
if(!epee::string_tools::parse_hexstr_to_binbuff(txkey_text, tx_key_data) || tx_key_data.size() != sizeof(crypto::hash))
|
||||
{
|
||||
error = tr("failed to parse tx key");
|
||||
return false;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue