Commit 406630a0 authored by Misha Efimov's avatar Misha Efimov Committed by Commit Bot

[Cronet] Fix HistogramManager.HistogramBucketFields crashes on Win7 Tests

Bug: 812268
Cq-Include-Trybots: master.tryserver.chromium.android:android_cronet_tester;master.tryserver.chromium.mac:ios-simulator-cronet
Change-Id: I15a0d9f4e3a0c16d9a63e82ebb10943e082e1835
Reviewed-on: https://chromium-review.googlesource.com/999331Reviewed-by: default avatarWez <wez@chromium.org>
Commit-Queue: Wez <wez@chromium.org>
Cr-Commit-Position: refs/heads/master@{#548845}
parent 8d3b098d
...@@ -49,7 +49,7 @@ bool HistogramManager::GetDeltas(std::vector<uint8_t>* data) { ...@@ -49,7 +49,7 @@ bool HistogramManager::GetDeltas(std::vector<uint8_t>* data) {
&histogram_snapshot_manager_); &histogram_snapshot_manager_);
int32_t data_size = uma_proto_.ByteSize(); int32_t data_size = uma_proto_.ByteSize();
data->resize(data_size); data->resize(data_size);
if (uma_proto_.SerializeToArray(&(*data)[0], data_size)) if (data_size == 0 || uma_proto_.SerializeToArray(data->data(), data_size))
return true; return true;
} }
data->clear(); data->clear();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment