summaryrefslogtreecommitdiff
path: root/apt-pkg
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2011-08-01 12:57:04 +0200
committerMichael Vogt <michael.vogt@ubuntu.com>2011-08-01 12:57:04 +0200
commit77de0e831a12aedde05ff6bff8fb07dcbb4074ad (patch)
tree4e11e535b0644b4fb09877828d2c81204bb6fcec /apt-pkg
parent194fac6be95e698d8eec86ddf19ebc1e7ca6d5c7 (diff)
apt-pkg/pkgcachegen.cc: copy Arch to avoid segfault on cache remap
Diffstat (limited to 'apt-pkg')
-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 efd764b51..2bfb77609 100644
--- a/apt-pkg/pkgcachegen.cc
+++ b/apt-pkg/pkgcachegen.cc
@@ -636,7 +636,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