summaryrefslogtreecommitdiff
path: root/apt-pkg/pkgcachegen.cc
diff options
context:
space:
mode:
authorMichael Vogt <egon@debian-devbox>2011-08-01 15:32:16 +0200
committerMichael Vogt <egon@debian-devbox>2011-08-01 15:32:16 +0200
commit3bbcf3b90405b25fc3a53dad0a6afdf341de528c (patch)
tree801e2edc33e6548cacebcef522834de603e2ed40 /apt-pkg/pkgcachegen.cc
parent5e7b0aa9eb884f663c3a87968057d9f540fe0175 (diff)
parent77de0e831a12aedde05ff6bff8fb07dcbb4074ad (diff)
fix crash when P.Arch() was used but the cache got remapped
Diffstat (limited to 'apt-pkg/pkgcachegen.cc')
-rw-r--r--apt-pkg/pkgcachegen.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/apt-pkg/pkgcachegen.cc b/apt-pkg/pkgcachegen.cc
index 2b6d294fb..0e6ae698d 100644
--- a/apt-pkg/pkgcachegen.cc
+++ b/apt-pkg/pkgcachegen.cc
@@ -637,7 +637,9 @@ bool pkgCacheGenerator::FinishCache(OpProgress *Progress)
Dynamic<pkgCache::VerIterator> DynV(V);
for (; V.end() != true; V++)
{
- char const * const Arch = P.Arch();
+ // copy P.Arch() into a string here as a cache remap
+ // in NewDepends() later may alter the pointer location
+ string Arch = P.Arch() == NULL ? "" : P.Arch();
map_ptrloc *OldDepLast = NULL;
/* MultiArch handling introduces a lot of implicit Dependencies:
- MultiArch: same → Co-Installable if they have the same version