simplewallet: validate hex input size

This commit is contained in:
moneromooo-monero 2017-02-14 19:35:44 +00:00
parent 3f171b931f
commit 83ec209f42
No known key found for this signature in database
GPG key ID: 686F07454D6CEFC3
5 changed files with 21 additions and 21 deletions

View file

@ -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;