summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJay Freeman (saurik) <saurik@saurik.com>2016-12-30 13:48:31 -0800
committerJay Freeman (saurik) <saurik@saurik.com>2016-12-30 13:48:31 -0800
commit7cafe70555740bd0acbf0b8d2193b95423e7436b (patch)
treee3fc52bc3fd2b278567140436a542dbf2182a44e
parent4f1e54bea150c1db7b391d115ce19192463430d4 (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 c5c668fd3..1aa67cc67 100644
--- a/apt-pkg/tagfile.cc
+++ b/apt-pkg/tagfile.cc
@@ -389,7 +389,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;
}