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:
jeffro256
2025-07-11 10:39:00 -05:00
parent 125622d5bd
commit 6131ddef10

View File

@@ -1287,8 +1287,10 @@ namespace cryptonote
if(b.size() != sizeof(crypto::key_image)) if(b.size() != sizeof(crypto::key_image))
{ {
res.status = "Failed, size of data mismatch"; res.status = "Failed, size of data mismatch";
return true;
} }
key_images.push_back(*reinterpret_cast<const crypto::key_image*>(b.data())); crypto::key_image &ki = key_images.emplace_back();
memcpy(&ki, b.data(), sizeof(crypto::key_image));
} }
std::vector<bool> spent_status; std::vector<bool> spent_status;
bool r = m_core.are_key_images_spent(key_images, spent_status); bool r = m_core.are_key_images_spent(key_images, spent_status);