Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1070)

Unified Diff: base/metrics/sample_map.cc

Issue 1618423004: Fix overflow bug in histogram sample data structures (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: base/metrics/sample_map.cc
diff --git a/base/metrics/sample_map.cc b/base/metrics/sample_map.cc
index a691243f340112fdcf6166c6a22777d516b9523e..e276b91643b6a4fa567b2e4f84eb09b94a92a38c 100644
--- a/base/metrics/sample_map.cc
+++ b/base/metrics/sample_map.cc
@@ -19,7 +19,7 @@ SampleMap::~SampleMap() {}
void SampleMap::Accumulate(Sample value, Count count) {
sample_counts_[value] += count;
- IncreaseSum(count * value);
+ IncreaseSum(static_cast<int64_t>(count) * value);
IncreaseRedundantCount(count);
}

Powered by Google App Engine
This is Rietveld 408576698