summaryrefslogtreecommitdiff
path: root/apt-pkg/cachefile.cc
diff options
context:
space:
mode:
Diffstat (limited to 'apt-pkg/cachefile.cc')
-rw-r--r--apt-pkg/cachefile.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/apt-pkg/cachefile.cc b/apt-pkg/cachefile.cc
index aaa2436c5..39f1e72db 100644
--- a/apt-pkg/cachefile.cc
+++ b/apt-pkg/cachefile.cc
@@ -80,6 +80,8 @@ bool pkgCacheFile::BuildCaches(OpProgress *Progress, bool WithLock)
if (file.IsOpen() == false || file.Failed())
return false;
Map = new MMap(file, MMap::Public|MMap::ReadOnly);
+ if (unlikely(Map->validData() == false))
+ return false;
Cache = new pkgCache(Map);
return _error->PendingError() == false;
}