diff options
Diffstat (limited to 'apt-pkg')
-rw-r--r-- | apt-pkg/tagfile.cc | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/apt-pkg/tagfile.cc b/apt-pkg/tagfile.cc index bbece1d7e..b86936353 100644 --- a/apt-pkg/tagfile.cc +++ b/apt-pkg/tagfile.cc @@ -714,8 +714,13 @@ StringView pkgTagSection::Find(Key key) const StringView pkgTagSection::FindRawInternal(unsigned int Pos) const { char const *Start = (char const *) memchr(Section + d->Tags[Pos].EndTag, ':', d->Tags[Pos].StartValue - d->Tags[Pos].EndTag); - ++Start; char const *End = Section + d->Tags[Pos + 1].StartTag; + + if (Start == nullptr) + return ""; + + ++Start; + if (unlikely(Start > End)) return ""; |