summaryrefslogtreecommitdiff
path: root/apt-pkg/policy.cc
diff options
context:
space:
mode:
authorDavid Kalnischkies <kalnischkies@gmail.com>2011-01-13 17:16:11 +0100
committerDavid Kalnischkies <kalnischkies@gmail.com>2011-01-13 17:16:11 +0100
commitc55b8a54780c4db6a5fa270ddd2d05ab837f6ffb (patch)
tree3059c5ed654e4764f6b549748fbf2ab2bef63536 /apt-pkg/policy.cc
parentf688d1d3c90091c308ec979eabab511134810be9 (diff)
* apt-pkg/cacheiterator.h:
- do not segfault if cache is not build (Closes: #254770)
Diffstat (limited to 'apt-pkg/policy.cc')
-rw-r--r--apt-pkg/policy.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/apt-pkg/policy.cc b/apt-pkg/policy.cc
index f05b6ca49..5427271b6 100644
--- a/apt-pkg/policy.cc
+++ b/apt-pkg/policy.cc
@@ -45,6 +45,8 @@ using namespace std;
file matches the V0 policy engine. */
pkgPolicy::pkgPolicy(pkgCache *Owner) : Pins(0), PFPriority(0), Cache(Owner)
{
+ if (Owner == 0 || &(Owner->Head()) == 0)
+ return;
PFPriority = new signed short[Owner->Head().PackageFileCount];
Pins = new Pin[Owner->Head().PackageCount];