Skip to content

Commit 35c2ea2

Browse files
committed
fix potential stat overflow
1 parent 3a7f2cf commit 35c2ea2

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

h2load_utils.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1067,7 +1067,8 @@ void output_realtime_stats(h2load::Config& config,
10671067
size_t sum = 0;
10681068
for (auto& one_d_vec : two_d_vec)
10691069
{
1070-
sum += std::accumulate(one_d_vec.begin(), one_d_vec.end(), 0);
1070+
size_t init = 0;
1071+
sum += std::accumulate(one_d_vec.begin(), one_d_vec.end(), init);
10711072
}
10721073
return sum;
10731074
};

0 commit comments

Comments
 (0)