summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJay Freeman (saurik) <saurik@saurik.com>2016-12-30 13:48:31 -0800
committerSam Bingner <sam@bingner.com>2019-08-17 12:41:40 -1000
commitf7771a426fcd7d18b88f18454b08a88cdab515b6 (patch)
treebccc93dedcfaa1f92daf1b3a16aea60e7a5452d7
parent596ddf0c783d440e4817d928c0755d50262e0900 (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;
}