Commit 40269615 authored by Oystein Eftevaag's avatar Oystein Eftevaag Committed by Commit Bot

Explicitly initialize the ScatteredStreamWriter used by tracing ProtoWriter

The writer would always end up being initialized in WriteBytes regardless,
but this prevents ClusterFuzz from throwing up false alarms due to
non-zero offsets being applied to a null pointer.

R=eseckler@chromium.org

Bug: 1031563
Change-Id: I3c938bc388194889fa7b7562c30c7d156000fce3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1962982Reviewed-by: default avatarEric Seckler <eseckler@chromium.org>
Commit-Queue: oysteine <oysteine@chromium.org>
Cr-Commit-Position: refs/heads/master@{#724086}
parent 0e41e52f
......@@ -53,6 +53,7 @@ class ProtoWriter final : public TracedValue::Writer {
stream_(&buffer_) {
proto_.Reset(&stream_);
buffer_.set_writer(&stream_);
stream_.Reset(buffer_.GetNewBuffer());
node_stack_.emplace(ProtoValueHandle(&proto_));
proto_.set_nested_type(ProtoValue::DICT);
}
......
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