summaryrefslogtreecommitdiff
path: root/apt-pkg/policy.cc
diff options
context:
space:
mode:
authorMichael Vogt <mvo@debian.org>2013-12-29 16:04:42 +0100
committerMichael Vogt <mvo@debian.org>2013-12-29 16:04:42 +0100
commitf99a02461efe5183a00d5e73da197b85f93cf57a (patch)
tree1286d59d9700b4626111347bce45820a7cad6aba /apt-pkg/policy.cc
parenta127de147900050d3dbc3644ed468428749c46fd (diff)
parent23bd09778261c945b460b46d855b1a6ef998cfd8 (diff)
Merge remote-tracking branch 'mvo/debian/sid' into debian/sid
Diffstat (limited to 'apt-pkg/policy.cc')
-rw-r--r--apt-pkg/policy.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/apt-pkg/policy.cc b/apt-pkg/policy.cc
index 0a06cc6e3..d0f97441d 100644
--- a/apt-pkg/policy.cc
+++ b/apt-pkg/policy.cc
@@ -405,6 +405,10 @@ bool ReadPinFile(pkgPolicy &Plcy,string File)
PreferenceSection Tags;
while (TF.Step(Tags) == true)
{
+ // can happen when there are only comments in a record
+ if (Tags.Count() == 0)
+ continue;
+
string Name = Tags.FindS("Package");
if (Name.empty() == true)
return _error->Error(_("Invalid record in the preferences file %s, no Package header"), File.c_str());