Skip to content

Commit

Permalink
fix potential stat overflow
Browse files Browse the repository at this point in the history
  • Loading branch information
wallyatgithub committed Jul 26, 2023
1 parent 3a7f2cf commit 35c2ea2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion h2load_utils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1067,7 +1067,8 @@ void output_realtime_stats(h2load::Config& config,
size_t sum = 0;
for (auto& one_d_vec : two_d_vec)
{
sum += std::accumulate(one_d_vec.begin(), one_d_vec.end(), 0);
size_t init = 0;
sum += std::accumulate(one_d_vec.begin(), one_d_vec.end(), init);
}
return sum;
};
Expand Down

0 comments on commit 35c2ea2

Please sign in to comment.