diff options
author | David Kalnischkies <kalnischkies@gmail.com> | 2012-05-05 02:06:49 +0200 |
---|---|---|
committer | David Kalnischkies <kalnischkies@gmail.com> | 2012-05-05 02:06:49 +0200 |
commit | 7f5aab82708813d86aab04029095988f40a8462e (patch) | |
tree | 2fe80eccfb17c1af81075a50a37efb3c5d058d14 /apt-pkg | |
parent | 9a4ffe576267539ae5549f0c77cc8ab37c2516fb (diff) | |
download | apt-7f5aab82708813d86aab04029095988f40a8462e.tar.gz |
check if we work on a valid description in IsDuplicateDescription as
we end up working on dangling pointers otherwise which segfaults on
s390x and ppc64 (Closes: #669427)
Diffstat (limited to 'apt-pkg')
-rw-r--r-- | apt-pkg/pkgcachegen.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/apt-pkg/pkgcachegen.cc b/apt-pkg/pkgcachegen.cc index 5e0726f3b..d455e4070 100644 --- a/apt-pkg/pkgcachegen.cc +++ b/apt-pkg/pkgcachegen.cc @@ -286,7 +286,7 @@ bool pkgCacheGenerator::MergeListPackage(ListParser &List, pkgCache::PkgIterator pkgCache::DescIterator Desc = Ver.DescriptionList(); // a version can only have one md5 describing it - if (MD5SumValue(Desc.md5()) != CurMd5) + if (Desc.end() == true || MD5SumValue(Desc.md5()) != CurMd5) continue; // don't add a new description if we have one for the given @@ -1459,7 +1459,7 @@ bool IsDuplicateDescription(pkgCache::DescIterator Desc, MD5SumValue const &CurMd5, std::string const &CurLang) { // Descriptions in the same link-list have all the same md5 - if (MD5SumValue(Desc.md5()) != CurMd5) + if (Desc.end() == true || MD5SumValue(Desc.md5()) != CurMd5) return false; for (; Desc.end() == false; ++Desc) if (Desc.LanguageCode() == CurLang) |