mirror of
https://github.com/monero-project/monero.git
synced 2025-10-17 09:10:42 -04:00
add empty container sanity checks when using front() and back()
This commit is contained in:
parent
56fa6ce15f
commit
45a1c4c088
9 changed files with 32 additions and 6 deletions
|
@ -4950,6 +4950,7 @@ bool wallet2::tx_add_fake_output(std::vector<std::vector<tools::wallet2::get_out
|
|||
if (global_index == real_index) // don't re-add real one
|
||||
return false;
|
||||
auto item = std::make_tuple(global_index, tx_public_key, mask);
|
||||
CHECK_AND_ASSERT_MES(!outs.empty(), false, "internal error: outs is empty");
|
||||
if (std::find(outs.back().begin(), outs.back().end(), item) != outs.back().end()) // don't add duplicates
|
||||
return false;
|
||||
outs.back().push_back(item);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue