X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/eff0c22e59e65b6b63e854ff41eb091278e05714..acddd9188c21c2e13aff5cea3a82f2d01aff788b:/apt-pkg/tagfile.cc diff --git a/apt-pkg/tagfile.cc b/apt-pkg/tagfile.cc index 3a3a3a04a..69148e08b 100644 --- a/apt-pkg/tagfile.cc +++ b/apt-pkg/tagfile.cc @@ -300,7 +300,7 @@ static void RemoveCommentsFromBuffer(pkgTagFilePrivate * const d) std::vector> good_parts; while (current <= d->End) { - size_t const restLength = (d->End - current) + 1; + size_t const restLength = (d->End - current); if (d->isCommentedLine == false) { current = static_cast(memchr(current, '#', restLength)); @@ -335,7 +335,7 @@ static void RemoveCommentsFromBuffer(pkgTagFilePrivate * const d) } ++current; // is the next line a comment, too? - if (current > d->End || *current != '#') + if (current >= d->End || *current != '#') { d->chunks.emplace_back(false, (current - bad_start)); good_start = current;