summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJay Freeman (saurik) <saurik@saurik.com>2016-12-30 12:50:56 -0800
committerSam Bingner <sam@bingner.com>2020-07-17 00:22:23 -1000
commit8c023a46bef110162459eb3d1e45c131b6f49384 (patch)
tree8a106360072466fa856820d3e1251dfce208a138
parentd58bd5d7226d40a886145a873f105ebb6abea763 (diff)
Fix field-without-values appearing at end of file.
-rw-r--r--apt-pkg/tagfile.cc4
1 files changed, 1 insertions, 3 deletions
diff --git a/apt-pkg/tagfile.cc b/apt-pkg/tagfile.cc
index 34cd721c6..250f7ac17 100644
--- a/apt-pkg/tagfile.cc
+++ b/apt-pkg/tagfile.cc
@@ -277,10 +277,8 @@ bool pkgTagSection::Scan(const char *Start,unsigned long MaxLength,bool const Su
// find the beginning of the value
Stop = Colon + 1;
for (; Stop < End && isspace_ascii(*Stop) != 0; ++Stop)
- if (*Stop == '\n' && Stop[1] != ' ')
+ if (*Stop == '\n' && (Stop+1 == End || Stop[1] != ' '))
break;
- if (Stop >= End)
- return false;
lastTagData.StartValue = Stop - Section;
}