Chromium Code Reviews| Index: net/disk_cache/blockfile/mapped_file.cc |
| diff --git a/net/disk_cache/blockfile/mapped_file.cc b/net/disk_cache/blockfile/mapped_file.cc |
| index b2fedd2c787a418f244c90526b06c559f7911631..ae2bd327b2e82dfe37caf3ee60eda5a542d47411 100644 |
| --- a/net/disk_cache/blockfile/mapped_file.cc |
| +++ b/net/disk_cache/blockfile/mapped_file.cc |
| @@ -23,6 +23,8 @@ bool MappedFile::Store(const FileBlock* block) { |
| bool MappedFile::Preload() { |
| size_t file_len = GetLength(); |
| + if (!file_len) |
|
danakj
2016/11/29 01:48:01
I don't think this is strictly needed. Reading 0 i
|
| + return false; |
| std::unique_ptr<char[]> buf(new char[file_len]); |
| if (!Read(buf.get(), file_len, 0)) |
| return false; |