Browse Source

do not ++ on erased package pointers in autoremove

Symptom: In an Ubuntu precise chroot (like on travis-ci)
test-bug-613420-new-garbage-dependency segfaults in a std::set
operator++ on an iterator we have erased previously
(but not if run under gdb of course)
tags/debian/0.9.12
David Kalnischkies 8 years ago
parent
commit
3a7a206f40
1 changed files with 7 additions and 3 deletions
  1. +7
    -3
      apt-private/private-install.cc

+ 7
- 3
apt-private/private-install.cc View File

@@ -438,15 +438,15 @@ bool DoAutomaticRemove(CacheFile &Cache)
do {
Changed = false;
for (APT::PackageSet::const_iterator Pkg = tooMuch.begin();
Pkg != tooMuch.end() && Changed == false; ++Pkg)
Pkg != tooMuch.end(); ++Pkg)
{
APT::PackageSet too;
too.insert(*Pkg);
for (pkgCache::PrvIterator Prv = Cache[Pkg].CandidateVerIter(Cache).ProvidesList();
Prv.end() == false; ++Prv)
too.insert(Prv.ParentPkg());
for (APT::PackageSet::const_iterator P = too.begin();
P != too.end() && Changed == false; ++P) {
for (APT::PackageSet::const_iterator P = too.begin(); P != too.end(); ++P)
{
for (pkgCache::DepIterator R = P.RevDependsList();
R.end() == false; ++R)
{
@@ -465,7 +465,11 @@ bool DoAutomaticRemove(CacheFile &Cache)
Changed = true;
break;
}
if (Changed == true)
break;
}
if (Changed == true)
break;
}
} while (Changed == true);
}


Loading…
Cancel
Save