summaryrefslogtreecommitdiff
path: root/apt-pkg/pkgcachegen.cc
diff options
context:
space:
mode:
authorMichael Vogt <egon@debian-devbox>2012-05-11 16:21:05 +0200
committerMichael Vogt <egon@debian-devbox>2012-05-11 16:21:05 +0200
commit3f81d67e1b732c1fdc8c17990249eda0fc2e09d6 (patch)
tree038dbe61e80ac809de33bb8fc3c74e24f7fb8be6 /apt-pkg/pkgcachegen.cc
parent99b4fefe0f303cf5ae5e8b9116404fc0fcc96e47 (diff)
parenta00a9b44a1e0abf944d88c36ceaac8afdd207dcb (diff)
merged from david
Diffstat (limited to 'apt-pkg/pkgcachegen.cc')
-rw-r--r--apt-pkg/pkgcachegen.cc10
1 files changed, 8 insertions, 2 deletions
diff --git a/apt-pkg/pkgcachegen.cc b/apt-pkg/pkgcachegen.cc
index ec072fddd..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
@@ -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;
@@ -1453,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)