Commit 62f9a539 authored by Dominik Röttsches's avatar Dominik Röttsches Committed by Commit Bot

Double check size of read protobuf memory

Speculative fix for issue 980094. Ensure that the read protobuf memory
has a size and is not a nullptr before trying to have the ProtoBuf
library parse it.

Bug: 980094
Change-Id: Idaf47884e82eff8c0850a6ec27fc8d452c10e622
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1768762
Auto-Submit: Dominik Röttsches <drott@chromium.org>
Commit-Queue: Koji Ishii <kojii@chromium.org>
Reviewed-by: default avatarKoji Ishii <kojii@chromium.org>
Cr-Commit-Position: refs/heads/master@{#690236}
parent 0fd01676
......@@ -48,7 +48,8 @@ bool LoadFromFile(base::FilePath file_path,
const char* proto_data = nullptr;
int proto_length = 0;
if (!pickle_iterator.ReadData(&proto_data, &proto_length)) {
if (!pickle_iterator.ReadData(&proto_data, &proto_length) || !proto_data ||
proto_length <= 0) {
return false;
}
......
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