From 5954d4d2020a247d414c7e064a87f9464be85fcf Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Wed, 2 May 2012 22:00:02 +0200 Subject: * apt-pkg/pkgcachegen.cc: - check if NewDescription allocation has failed and error out accordingly --- apt-pkg/pkgcachegen.cc | 6 ++++++ debian/changelog | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/apt-pkg/pkgcachegen.cc b/apt-pkg/pkgcachegen.cc index ec072fddd..5e0726f3b 100644 --- a/apt-pkg/pkgcachegen.cc +++ b/apt-pkg/pkgcachegen.cc @@ -304,6 +304,9 @@ bool pkgCacheGenerator::MergeListPackage(ListParser &List, pkgCache::PkgIterator void const * const oldMap = Map.Data(); 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()) LastDesc += (map_ptrloc*) Map.Data() - (map_ptrloc*) oldMap; *LastDesc = descindex; @@ -456,6 +459,9 @@ bool pkgCacheGenerator::MergeListVersion(ListParser &List, pkgCache::PkgIterator oldMap = Map.Data(); 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()) LastDesc += (map_ptrloc*) Map.Data() - (map_ptrloc*) oldMap; *LastDesc = descindex; diff --git a/debian/changelog b/debian/changelog index d77de1b3a..799653d5f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -26,8 +26,10 @@ apt (0.9.3) unstable; urgency=low like one provided with RootDir triggers the usage of EDSP * debian/libapt-inst1.5.symbols: - use the correct library name the symbols header + * apt-pkg/pkgcachegen.cc: + - check if NewDescription allocation has failed and error out accordingly - -- David Kalnischkies Wed, 02 May 2012 19:18:51 +0200 + -- David Kalnischkies Wed, 02 May 2012 21:59:02 +0200 apt (0.9.2) unstable; urgency=low -- cgit v1.2.3