From 7720666fba9cd7024009bed964ccfa3f2be97c59 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Thu, 19 Jan 2012 16:28:20 +0100 Subject: * apt-pkg/deb/dpkgpm.cc: - fix segfault on pkg removal --- apt-pkg/deb/dpkgpm.cc | 6 +++++- debian/changelog | 8 ++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/apt-pkg/deb/dpkgpm.cc b/apt-pkg/deb/dpkgpm.cc index 6feada4cc..99c28d201 100644 --- a/apt-pkg/deb/dpkgpm.cc +++ b/apt-pkg/deb/dpkgpm.cc @@ -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); diff --git a/debian/changelog b/debian/changelog index bf23ec1eb..d8316abf6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -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 Thu, 19 Jan 2012 16:28:03 +0100 + apt (0.8.16~exp11) experimental; urgency=low [ David Kalnischkies ] -- cgit v1.2.3