Skip to content

Commit

Permalink
fix: Create set copy to prevent reading after deletion.
Browse files Browse the repository at this point in the history
  • Loading branch information
polistern committed Jul 12, 2022
1 parent 5ff6ce7 commit 9b08c7f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/DHTStorage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -649,7 +649,8 @@ DHTStorage::remove_old_entries()
}

const int32_t ts = ts_now ();
for (const auto& pkt : local_index_packets)
std::set<std::string> index_copy = local_index_packets;
for (const auto& pkt : index_copy)
{
i2p::data::Tag<32> key;
key.FromBase64(pkt);
Expand Down

0 comments on commit 9b08c7f

Please sign in to comment.