Skip to content

Commit

Permalink
Fix accessing invalid iterator in historical state (#6609)
Browse files Browse the repository at this point in the history
  • Loading branch information
maxtropets authored Nov 4, 2024
1 parent 09669ad commit f1bd349
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/node/historical_queries.h
Original file line number Diff line number Diff line change
Expand Up @@ -265,14 +265,14 @@ namespace ccf::historical
auto new_it = new_seqnos.begin();
while (new_it != new_seqnos.end())
{
if (*new_it == prev_it->first)
if (prev_it != my_stores.end() && *new_it == prev_it->first)
{
// Asking for a seqno which was also requested previously - do
// nothing and advance to compare next entries
++new_it;
++prev_it;
}
else if (*new_it > prev_it->first)
else if (prev_it != my_stores.end() && *new_it > prev_it->first)
{
// No longer looking for a seqno which was previously requested.
// Remove it from my_stores
Expand Down

0 comments on commit f1bd349

Please sign in to comment.