Sfoglia il codice sorgente

* apt-pkg/pkgcachegen.cc:
- check if NewDescription allocation has failed and error out accordingly

David Kalnischkies 14 anni fa
parent
commit
5954d4d202
2 ha cambiato i file con 9 aggiunte e 1 eliminazioni
  1. 6 0
      apt-pkg/pkgcachegen.cc
  2. 3 1
      debian/changelog

+ 6 - 0
apt-pkg/pkgcachegen.cc

@@ -304,6 +304,9 @@ bool pkgCacheGenerator::MergeListPackage(ListParser &List, pkgCache::PkgIterator
 
 
       void const * const oldMap = Map.Data();
       void const * const oldMap = Map.Data();
       map_ptrloc const descindex = NewDescription(Desc, CurLang, CurMd5, *LastDesc);
       map_ptrloc const descindex = NewDescription(Desc, CurLang, CurMd5, *LastDesc);
+      if (unlikely(descindex == 0 && _error->PendingError()))
+	 return _error->Error(_("Error occurred while processing %s (%s%d)"),
+			      Pkg.Name(), "NewDescription", 1);
       if (oldMap != Map.Data())
       if (oldMap != Map.Data())
 	 LastDesc += (map_ptrloc*) Map.Data() - (map_ptrloc*) oldMap;
 	 LastDesc += (map_ptrloc*) Map.Data() - (map_ptrloc*) oldMap;
       *LastDesc = descindex;
       *LastDesc = descindex;
@@ -456,6 +459,9 @@ bool pkgCacheGenerator::MergeListVersion(ListParser &List, pkgCache::PkgIterator
 
 
    oldMap = Map.Data();
    oldMap = Map.Data();
    map_ptrloc const descindex = NewDescription(Desc, CurLang, CurMd5, *LastDesc);
    map_ptrloc const descindex = NewDescription(Desc, CurLang, CurMd5, *LastDesc);
+   if (unlikely(descindex == 0 && _error->PendingError()))
+      return _error->Error(_("Error occurred while processing %s (%s%d)"),
+			   Pkg.Name(), "NewDescription", 2);
    if (oldMap != Map.Data())
    if (oldMap != Map.Data())
        LastDesc += (map_ptrloc*) Map.Data() - (map_ptrloc*) oldMap;
        LastDesc += (map_ptrloc*) Map.Data() - (map_ptrloc*) oldMap;
    *LastDesc = descindex;
    *LastDesc = descindex;

+ 3 - 1
debian/changelog

@@ -26,8 +26,10 @@ apt (0.9.3) unstable; urgency=low
       like one provided with RootDir triggers the usage of EDSP
       like one provided with RootDir triggers the usage of EDSP
   * debian/libapt-inst1.5.symbols:
   * debian/libapt-inst1.5.symbols:
     - use the correct library name the symbols header
     - use the correct library name the symbols header
+  * apt-pkg/pkgcachegen.cc:
+    - check if NewDescription allocation has failed and error out accordingly
 
 
- -- David Kalnischkies <kalnischkies@gmail.com>  Wed, 02 May 2012 19:18:51 +0200
+ -- David Kalnischkies <kalnischkies@gmail.com>  Wed, 02 May 2012 21:59:02 +0200
 
 
 apt (0.9.2) unstable; urgency=low
 apt (0.9.2) unstable; urgency=low