From 36f1098aed548651a32a2c15cc9ad80c4330b4d9 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Wed, 12 Jan 2011 17:09:04 +0100 Subject: * apt-pkg/contrib/fileutl.cc: - add a RealFileExists method and check that your configuration files are real files to avoid endless loops if not (Closes: #604401) --- apt-pkg/policy.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'apt-pkg/policy.cc') diff --git a/apt-pkg/policy.cc b/apt-pkg/policy.cc index 4f9d56775..f05b6ca49 100644 --- a/apt-pkg/policy.cc +++ b/apt-pkg/policy.cc @@ -328,7 +328,7 @@ bool ReadPinFile(pkgPolicy &Plcy,string File) if (File.empty() == true) File = _config->FindFile("Dir::Etc::Preferences"); - if (FileExists(File) == false) + if (RealFileExists(File) == false) return true; FileFd Fd(File,FileFd::ReadOnly); -- cgit v1.2.3 From c55b8a54780c4db6a5fa270ddd2d05ab837f6ffb Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Thu, 13 Jan 2011 17:16:11 +0100 Subject: * apt-pkg/cacheiterator.h: - do not segfault if cache is not build (Closes: #254770) --- apt-pkg/policy.cc | 2 ++ 1 file changed, 2 insertions(+) (limited to 'apt-pkg/policy.cc') 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]; -- cgit v1.2.3