]> git.saurik.com Git - apt.git/commitdiff
* apt-pkg/pkgcachegen.{cc,h}:
authorMichael Vogt <michael.vogt@ubuntu.com>
Fri, 29 Jul 2011 11:37:33 +0000 (13:37 +0200)
committerMichael Vogt <michael.vogt@ubuntu.com>
Fri, 29 Jul 2011 11:37:33 +0000 (13:37 +0200)
  - use ref-to-ptr semantic in NewDepends() to ensure that the
    libapt does not segfault if the cache is remapped in between
    (LP: #812862)

apt-pkg/pkgcachegen.cc
apt-pkg/pkgcachegen.h
debian/changelog

index d0ea2e6e3ea8b5f4431bc26090f056b1c3a1ec51..ebcbfdd25f4f319b16445ed9afd540ef90723284 100644 (file)
@@ -105,6 +105,9 @@ void pkgCacheGenerator::ReMap(void const * const oldMap, void const * const newM
    if (oldMap == newMap)
       return;
 
+   if (_config->FindB("Debug::pkgCacheGen", false))
+      std::clog << "Remaping from " << oldMap << " to " << newMap << std::endl;
+
    Cache.ReMap(false);
 
    CurrentFile += (pkgCache::PackageFile*) newMap - (pkgCache::PackageFile*) oldMap;
@@ -684,7 +687,7 @@ bool pkgCacheGenerator::NewDepends(pkgCache::PkgIterator &Pkg,
                                   string const &Version,
                                   unsigned int const &Op,
                                   unsigned int const &Type,
-                                  map_ptrloc *OldDepLast)
+                                  map_ptrloc* &OldDepLast)
 {
    void const * const oldMap = Map.Data();
    // Get a structure
index ff198833a801f9cd601e25980ff5470d303b5128..c260511826ab36dc94472aedc3b66d713d982712 100644 (file)
@@ -75,7 +75,7 @@ class pkgCacheGenerator                                                       /*{{{*/
    bool NewFileDesc(pkgCache::DescIterator &Desc,ListParser &List);
    bool NewDepends(pkgCache::PkgIterator &Pkg, pkgCache::VerIterator &Ver,
                   string const &Version, unsigned int const &Op,
-                  unsigned int const &Type, map_ptrloc *OldDepLast);
+                  unsigned int const &Type, map_ptrloc* &OldDepLast);
    unsigned long NewVersion(pkgCache::VerIterator &Ver,const string &VerStr,unsigned long Next);
    map_ptrloc NewDescription(pkgCache::DescIterator &Desc,const string &Lang,const MD5SumValue &md5sum,map_ptrloc Next);
 
index 3e1a619ac41d9edb07c52dbc6245748f60180a92..a8c7572339ceacffd5cc06e5c744af6f51c8ef5a 100644 (file)
@@ -17,6 +17,10 @@ apt (0.8.15.2) unstable; urgency=high
       that changes in the ordering there will be honored by apt
   * apt-pkg/sourcelist.{cc,h}:
     - add pkgSourceList::GetLastModifiedTime() helper
+  * apt-pkg/pkgcachegen.{cc,h}:
+    - use ref-to-ptr semantic in NewDepends() to ensure that the   
+      libapt does not segfault if the cache is remapped in between
+      (LP: #812862)
 
  -- Michael Vogt <mvo@debian.org>  Tue, 12 Jul 2011 11:54:47 +0200