From c72f5c4fb4b1d496a9bbdb421f25e986f0cba9bf Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Sun, 27 Dec 2015 21:52:01 +0100 Subject: deal with empty values properly in deb822 parser Regression introduced in 8710a36a01c0cb1648926792c2ad05185535558e, but such fields are unlikely in practice as it is just as simple to not have a field at all with the same result of not having a value. Closes: 808102 --- apt-pkg/tagfile.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'apt-pkg/tagfile.cc') diff --git a/apt-pkg/tagfile.cc b/apt-pkg/tagfile.cc index 668cfc3a4..a0b64f9ca 100644 --- a/apt-pkg/tagfile.cc +++ b/apt-pkg/tagfile.cc @@ -382,7 +382,9 @@ bool pkgTagSection::Scan(const char *Start,unsigned long MaxLength, bool const R lastTagHash = AlphaHash(Stop, EndTag - Stop); // find the beginning of the value Stop = Colon + 1; - for (; isspace_ascii(*Stop) != 0; ++Stop); + for (; isspace_ascii(*Stop) != 0; ++Stop) + if (*Stop == '\n' && Stop[1] != ' ') + break; if (Stop >= End) return false; lastTagData.StartValue = Stop - Section; -- cgit v1.2.3