Kaynağa Gözat

merge from lp:~mvo/apt/mvo

Michael Vogt 15 yıl önce
ebeveyn
işleme
410ea6525d
3 değiştirilmiş dosya ile 9 ekleme ve 2 silme
  1. 4 1
      apt-pkg/pkgcachegen.cc
  2. 1 1
      apt-pkg/pkgcachegen.h
  3. 4 0
      debian/changelog

+ 4 - 1
apt-pkg/pkgcachegen.cc

@@ -106,6 +106,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;
@@ -685,7 +688,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

+ 1 - 1
apt-pkg/pkgcachegen.h

@@ -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);
 

+ 4 - 0
debian/changelog

@@ -2,6 +2,10 @@ apt (0.8.16~exp5) UNRELEASED; urgency=low
 
   * apt-pkg/makefile:
     - install sha256.h compat header
+  * 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 <michael.vogt@ubuntu.com>  Fri, 29 Jul 2011 13:44:01 +0200