check if we work on a valid description in IsDuplicateDescription as
authorDavid Kalnischkies <kalnischkies@gmail.com>
Sat, 5 May 2012 00:06:49 +0000 (02:06 +0200)
committerDavid Kalnischkies <kalnischkies@gmail.com>
Sat, 5 May 2012 00:06:49 +0000 (02:06 +0200)
we end up working on dangling pointers otherwise which segfaults on
s390x and ppc64 (Closes: #669427)

apt-pkg/pkgcachegen.cc
debian/changelog

index 5e0726f..d455e40 100644 (file)
@@ -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)
index 72830ad..2c4bde3 100644 (file)
@@ -28,10 +28,13 @@ apt (0.9.3) unstable; urgency=low
     - use the correct library name the symbols header
   * apt-pkg/pkgcachegen.cc:
     - check if NewDescription allocation has failed and error out accordingly
+    - 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)
   * apt-pkg/deb/deblistparser.cc:
     - check length and containing chars for a given description md5sum
 
- -- David Kalnischkies <kalnischkies@gmail.com>  Wed, 02 May 2012 22:28:32 +0200
+ -- David Kalnischkies <kalnischkies@gmail.com>  Sat, 05 May 2012 02:02:41 +0200
 
 apt (0.9.2) unstable; urgency=low