* apt-pkg/deb/dpkgpm.cc:
authorMichael Vogt <michael.vogt@ubuntu.com>
Thu, 19 Jan 2012 15:28:20 +0000 (16:28 +0100)
committerMichael Vogt <michael.vogt@ubuntu.com>
Thu, 19 Jan 2012 15:28:20 +0000 (16:28 +0100)
  - fix segfault on pkg removal

apt-pkg/deb/dpkgpm.cc
debian/changelog

index 6feada4..99c28d2 100644 (file)
@@ -1090,8 +1090,12 @@ bool pkgDPkgPM::Go(int OutStatusFd)
            }
            else
            {
+              pkgCache::VerIterator PkgVer;
               std::string name = I->Pkg.Name();
-              pkgCache::VerIterator PkgVer = Cache[I->Pkg].InstVerIter(Cache);
+              if (Op == Item::Remove || Op == Item::Purge)
+                  PkgVer = I->Pkg.CurrentVer();
+              else
+                  PkgVer = Cache[I->Pkg].InstVerIter(Cache);
               name.append(":").append(PkgVer.Arch());
               char * const fullname = strdup(name.c_str());
               Packages.push_back(fullname);
index bf23ec1..d8316ab 100644 (file)
@@ -1,3 +1,11 @@
+apt (0.8.16~exp12) experimental; urgency=low
+
+  [ Michael Vogt ]
+  * apt-pkg/deb/dpkgpm.cc:
+    - fix segfault on pkg removal
+
+ -- Michael Vogt <michael.vogt@ubuntu.com>  Thu, 19 Jan 2012 16:28:03 +0100
+
 apt (0.8.16~exp11) experimental; urgency=low
 
   [ David Kalnischkies ]