summaryrefslogtreecommitdiff
path: root/apt-pkg/policy.cc
diff options
context:
space:
mode:
authorMichael Vogt <mvo@debian.org>2014-01-06 07:51:45 +0100
committerMichael Vogt <mvo@debian.org>2014-01-06 07:51:45 +0100
commit1b4560fec66a6e7b2dff9aaa19095fb8423f69a0 (patch)
tree7fb2b63e31f356ef87af4699ba87b4f1443f508c /apt-pkg/policy.cc
parent81d183681aea972fddd453d62109f8ccda3f447a (diff)
parent74d4bb26e09146b9d5f01889a676dc58ff5d63cd (diff)
Merge branch 'debian/sid' into feature/apt-manpage
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());