From: Jay Freeman (saurik) Date: Fri, 30 Dec 2016 21:48:31 +0000 (-0800) Subject: You have to do the bounds check before the access. X-Git-Tag: cydia_1.1.28%b4~2 X-Git-Url: https://git.saurik.com/apt.git/commitdiff_plain/7cafe70555740bd0acbf0b8d2193b95423e7436b You have to do the bounds check before the access. --- 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; }