summaryrefslogtreecommitdiff
path: root/apt-pkg/algorithms.cc
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2012-11-01 10:44:13 +0100
committerMichael Vogt <michael.vogt@ubuntu.com>2012-11-01 10:44:13 +0100
commitf69b2c3d2984cd4dca485fb05ab84df94067c50d (patch)
tree11ac3bcba3399c2fa5c8d7fc45555d490a0497ff /apt-pkg/algorithms.cc
parent6292ea19bc71d0c1b977693195dcf9153bd07555 (diff)
parent446fb1002ad218929f3a6da911388b160b738f2a (diff)
merged from the debian-sid branch
Diffstat (limited to 'apt-pkg/algorithms.cc')
-rw-r--r--apt-pkg/algorithms.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/apt-pkg/algorithms.cc b/apt-pkg/algorithms.cc
index 2f5fcc7ab..1b0161ffd 100644
--- a/apt-pkg/algorithms.cc
+++ b/apt-pkg/algorithms.cc
@@ -194,6 +194,11 @@ bool pkgSimulate::Remove(PkgIterator iPkg,bool Purge)
{
// Adapt the iterator
PkgIterator Pkg = Sim.FindPkg(iPkg.Name(), iPkg.Arch());
+ if (Pkg.end() == true)
+ {
+ std::cerr << (Purge ? "Purg" : "Remv") << " invalid package " << iPkg.FullName() << std::endl;
+ return false;
+ }
Flags[Pkg->ID] = 3;
Sim.MarkDelete(Pkg);