summaryrefslogtreecommitdiffstats
path: root/net/disk_cache/block_files.cc
diff options
context:
space:
mode:
Diffstat (limited to 'net/disk_cache/block_files.cc')
-rw-r--r--net/disk_cache/block_files.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/net/disk_cache/block_files.cc b/net/disk_cache/block_files.cc
index c9b5238..d73953d 100644
--- a/net/disk_cache/block_files.cc
+++ b/net/disk_cache/block_files.cc
@@ -419,6 +419,12 @@ bool BlockFiles::OpenBlockFile(int index) {
return false;
}
+ if (static_cast<int>(file_len) <
+ header->max_entries * header->entry_size + kBlockHeaderSize) {
+ LOG(ERROR) << "File too small " << name.value();
+ return false;
+ }
+
if (index == 0) {
// Load the links file into memory with a single read.
scoped_array<char> buf(new char[file_len]);