X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/ce1f3a2c616b86da657c1c796efa5f4d18c30c39..d04e44ac8177fc5b70ae0189bb5e437c2502f910:/apt-pkg/cachefile.cc 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; }