summaryrefslogtreecommitdiff
path: root/apt-pkg/algorithms.cc
diff options
context:
space:
mode:
authorMichael Vogt <egon@debian-devbox>2012-10-17 10:12:41 +0200
committerMichael Vogt <egon@debian-devbox>2012-10-17 10:12:41 +0200
commit32ed73df439850ee47e5e5edb8bfe1fe647ed794 (patch)
tree3a36260d49079236ae8c3c100de02455eed2d86e /apt-pkg/algorithms.cc
parentd624605d4a750ba8005b19b270c3a1617bbb9f72 (diff)
parent27a83019db71c604eb6eaecd4feed09ba376e980 (diff)
merged from debian-sid
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);