mirror of
https://github.com/monero-project/monero.git
synced 2025-08-18 05:40:27 -04:00
rpc: return error correctly on bad key image string
Because of the missing `return` statement, the status is set to "OK" later on in the method when it shouldn't be. Thank you to ADA Logics and the MAGIC Monero Fund for reporting this!
This commit is contained in:
parent
3e218c2021
commit
45152f9ef0
1 changed files with 4 additions and 1 deletions
|
@ -1240,8 +1240,11 @@ namespace cryptonote
|
|||
if(b.size() != sizeof(crypto::key_image))
|
||||
{
|
||||
res.status = "Failed, size of data mismatch";
|
||||
return true;
|
||||
}
|
||||
key_images.push_back(*reinterpret_cast<const crypto::key_image*>(b.data()));
|
||||
key_images.emplace_back();
|
||||
crypto::key_image &ki = key_images.back();
|
||||
memcpy(&ki, b.data(), sizeof(crypto::key_image));
|
||||
}
|
||||
std::vector<bool> spent_status;
|
||||
bool r = m_core.are_key_images_spent(key_images, spent_status);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue