Chromium Code Reviews| Index: net/disk_cache/blockfile/mapped_file_posix.cc |
| diff --git a/net/disk_cache/blockfile/mapped_file_posix.cc b/net/disk_cache/blockfile/mapped_file_posix.cc |
| index 99cf49c1890dfbd5d474460666aaa3bc420d170a..2eee9dceb8214715bb82c5a017e8ef83be58b4c7 100644 |
| --- a/net/disk_cache/blockfile/mapped_file_posix.cc |
| +++ b/net/disk_cache/blockfile/mapped_file_posix.cc |
| @@ -19,8 +19,11 @@ void* MappedFile::Init(const base::FilePath& name, size_t size) { |
| return NULL; |
| size_t temp_len = size ? size : 4096; |
| - if (!size) |
| + if (!size) { |
| size = GetLength(); |
| + if (!size) |
| + return NULL; |
|
danakj
2016/11/29 01:48:01
same same
|
| + } |
| buffer_ = mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED, |
| platform_file(), 0); |