summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJay Freeman (saurik) <saurik@saurik.com>2016-12-30 13:48:31 -0800
committerSam Bingner <sam@bingner.com>2020-07-17 00:22:23 -1000
commit57bbd0b1c0fed32c86fdcc375e37a36e8b6da5f5 (patch)
tree2bdce33e0d0365d39c0288bde15cd96bb80739b5
parent8c023a46bef110162459eb3d1e45c131b6f49384 (diff)
You have to do the bounds check before the access.
-rw-r--r--apt-pkg/tagfile.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/apt-pkg/tagfile.cc b/apt-pkg/tagfile.cc
index 250f7ac17..14f89f797 100644
--- a/apt-pkg/tagfile.cc
+++ b/apt-pkg/tagfile.cc
@@ -390,7 +390,7 @@ bool pkgTagSection::FindInternal(unsigned int Pos, const char *&Start,
if (unlikely(Start > End))
return _error->Error("Internal parsing error");
- for (; isspace_ascii(End[-1]) != 0 && End > Start; --End);
+ for (; End > Start && isspace_ascii(End[-1]) != 0; --End);
return true;
}