From: Michael Vogt Date: Mon, 1 Aug 2011 13:32:16 +0000 (+0200) Subject: fix crash when P.Arch() was used but the cache got remapped X-Git-Tag: 0.9.0~64 X-Git-Url: https://git.saurik.com/apt.git/commitdiff_plain/3bbcf3b90405b25fc3a53dad0a6afdf341de528c?hp=5e7b0aa9eb884f663c3a87968057d9f540fe0175 fix crash when P.Arch() was used but the cache got remapped --- 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 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 diff --git a/debian/changelog b/debian/changelog index 05502a92a..2d3f1a9c9 100644 --- a/debian/changelog +++ b/debian/changelog @@ -6,8 +6,9 @@ apt (0.8.16~exp5) UNRELEASED; urgency=low - use ref-to-ptr semantic in NewDepends() to ensure that the libapt does not segfault if the cache is remapped in between (LP: #812862) + - fix crash when P.Arch() was used but the cache got remapped - -- Michael Vogt Fri, 29 Jul 2011 13:44:01 +0200 + -- Michael Vogt Mon, 01 Aug 2011 15:31:55 +0200 apt (0.8.16~exp4) experimental; urgency=low @@ -105,13 +106,13 @@ apt (0.8.16~exp1) experimental; urgency=low -- Michael Vogt Wed, 29 Jun 2011 12:40:31 +0200 -apt (0.8.15.5) UNRELEASED; urgency=low +apt (0.8.15.5) unstable; urgency=low [ David Kalnischkies ] * apt-pkg/deb/deblistparser.cc: - do not assume that the last char on a line is a \n (Closes: #633350) - -- David Kalnischkies Wed, 27 Jul 2011 23:25:45 +0200 + -- Michael Vogt Thu, 28 Jul 2011 16:49:15 +0200 apt (0.8.15.4) unstable; urgency=low