Skip to content

Commit

Permalink
Avoid subtraction which may overflow.
Browse files Browse the repository at this point in the history
  • Loading branch information
greg7mdp committed Dec 16, 2024
1 parent 54950d3 commit 27a561d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/chainbase/chainbase_node_allocator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ namespace chainbase {

void preallocate(std::size_t num) {
if (num >= 2 * _allocation_batch_size)
get_some(((num - _freelist_size) + 7) & ~7);
get_some((num + 7) & ~7);
}

bool operator==(const chainbase_node_allocator& other) const { return this == &other; }
Expand Down

0 comments on commit 27a561d

Please sign in to comment.