diff options
author | Michael Vogt <michael.vogt@ubuntu.com> | 2011-07-28 10:21:58 +0200 |
---|---|---|
committer | Michael Vogt <michael.vogt@ubuntu.com> | 2011-07-28 10:21:58 +0200 |
commit | c6ec544822a6a5db9f8a507b08381f19c8787761 (patch) | |
tree | f4cf7c2f2a21d29642bf13e87b792cbb9df688a3 /apt-pkg/pkgcache.cc | |
parent | f448075d89fedde182e6c2a59c89808e403b7f66 (diff) | |
parent | a2cba9cca24762c090ee6988f14ae40f92a6441f (diff) |
merged from debian-experimental
Diffstat (limited to 'apt-pkg/pkgcache.cc')
-rw-r--r-- | apt-pkg/pkgcache.cc | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/apt-pkg/pkgcache.cc b/apt-pkg/pkgcache.cc index 38e4e904e..2b8cb6b86 100644 --- a/apt-pkg/pkgcache.cc +++ b/apt-pkg/pkgcache.cc @@ -84,6 +84,8 @@ pkgCache::Header::Header() memset(PkgHashTable,0,sizeof(PkgHashTable)); memset(GrpHashTable,0,sizeof(GrpHashTable)); memset(Pools,0,sizeof(Pools)); + + CacheFileSize = 0; } /*}}}*/ // Cache::Header::CheckSizes - Check if the two headers have same *sz /*{{{*/ @@ -155,6 +157,9 @@ bool pkgCache::ReMap(bool const &Errorchecks) HeaderP->CheckSizes(DefHeader) == false) return _error->Error(_("The package cache file is an incompatible version")); + if (Map.Size() < HeaderP->CacheFileSize) + return _error->Error(_("The package cache file is corrupted, it is too small")); + // Locate our VS.. if (HeaderP->VerSysName == 0 || (VS = pkgVersioningSystem::GetVS(StrP + HeaderP->VerSysName)) == 0) @@ -749,9 +754,6 @@ bool pkgCache::VerIterator::Automatic() const return false; } /*}}}*/ -// VerIterator::Pseudo - deprecated no-op method /*{{{*/ -bool pkgCache::VerIterator::Pseudo() const { return false; } - /*}}}*/ // VerIterator::NewestFile - Return the newest file version relation /*{{{*/ // --------------------------------------------------------------------- /* This looks at the version numbers associated with all of the sources |