diff options
author | David Kalnischkies <kalnischkies@gmail.com> | 2011-06-29 22:38:59 +0200 |
---|---|---|
committer | David Kalnischkies <kalnischkies@gmail.com> | 2011-06-29 22:38:59 +0200 |
commit | 5b7d1ee67575e311871fb73be421ea7fd2f6fd73 (patch) | |
tree | c045fd2e2c158e408e04d56e88cc726bae8539a6 /apt-pkg/policy.cc | |
parent | 9919af907aef04caa4061e411259525e46eb49e2 (diff) |
* apt-pkg/policy.cc:
- do not segfault in pinning if a package with this name doesn't exist.
Thanks to Ferdinand Thommes for the report!
Diffstat (limited to 'apt-pkg/policy.cc')
-rw-r--r-- | apt-pkg/policy.cc | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/apt-pkg/policy.cc b/apt-pkg/policy.cc index 2cc2e5e39..291d83c67 100644 --- a/apt-pkg/policy.cc +++ b/apt-pkg/policy.cc @@ -231,6 +231,9 @@ void pkgPolicy::CreatePin(pkgVersionMatch::MatchType Type,string Name, // Get a spot to put the pin pkgCache::GrpIterator Grp = Cache->FindGrp(Name); + if (Grp.end() == true) + return; + for (pkgCache::PkgIterator Pkg = Grp.PackageList(); Pkg.end() != true; Pkg = Grp.NextPkg(Pkg)) { |