Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Commit

Permalink
fix potential crash on assert
Browse files Browse the repository at this point in the history
  • Loading branch information
taokayan committed Mar 6, 2019
1 parent 580361f commit ad2f534
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions libraries/chain/fork_database.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -372,15 +372,17 @@ namespace eosio { namespace chain {
{
result.first.push_back(first_branch);
result.second.push_back(second_branch);
first_branch = get_block( first_branch->header.previous );
second_branch = get_block( second_branch->header.previous );
const auto &first_prev = first_branch->header.previous;
first_branch = get_block( first_prev );
const auto &second_prev = second_branch->header.previous;
second_branch = get_block( second_prev );
EOS_ASSERT( first_branch, fork_db_block_not_found,
"block ${id} does not exist",
("id", first_branch->header.previous)
("id", first_prev)
);
EOS_ASSERT( second_branch, fork_db_block_not_found,
"block ${id} does not exist",
("id", second_branch->header.previous)
("id", second_prev)
);
}

Expand Down

0 comments on commit ad2f534

Please sign in to comment.