From 77de0e831a12aedde05ff6bff8fb07dcbb4074ad Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Mon, 1 Aug 2011 12:57:04 +0200 Subject: apt-pkg/pkgcachegen.cc: copy Arch to avoid segfault on cache remap --- apt-pkg/pkgcachegen.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'apt-pkg/pkgcachegen.cc') 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 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 -- cgit v1.2.3-70-g09d2