diff options
author | Colin Watson <cjwatson@canonical.com> | 2012-10-14 23:51:09 +0100 |
---|---|---|
committer | Colin Watson <cjwatson@canonical.com> | 2012-10-14 23:51:09 +0100 |
commit | ab0bbca93e3c2e923d3c1497712a0dc366f597ff (patch) | |
tree | ad4dc3a9fe5d244abe3e5c8066ec6f6e191f8198 | |
parent | 582c0567f32d2a8de14dc9088e4961691bcf1e8b (diff) |
* apt-pkg/pkgcachegen.cc:
- Fix crash if the cache is remapped while writing a Provides version
(LP: #1066445).
-rw-r--r-- | apt-pkg/pkgcachegen.cc | 8 | ||||
-rw-r--r-- | debian/changelog | 8 |
2 files changed, 14 insertions, 2 deletions
diff --git a/apt-pkg/pkgcachegen.cc b/apt-pkg/pkgcachegen.cc index f70cbd02a..67018f057 100644 --- a/apt-pkg/pkgcachegen.cc +++ b/apt-pkg/pkgcachegen.cc @@ -917,8 +917,12 @@ bool pkgCacheGenerator::ListParser::NewProvides(pkgCache::VerIterator &Ver, Prv->Version = Ver.Index(); Prv->NextPkgProv = Ver->ProvidesList; Ver->ProvidesList = Prv.Index(); - if (Version.empty() == false && unlikely((Prv->ProvideVersion = WriteString(Version)) == 0)) - return false; + if (Version.empty() == false) { + map_ptrloc const idxProvideVersion = WriteString(Version); + Prv->ProvideVersion = idxProvideVersion; + if (unlikely(idxProvideVersion == 0)) + return false; + } // Locate the target package pkgCache::PkgIterator Pkg; diff --git a/debian/changelog b/debian/changelog index e7b531ea0..e2b24bc75 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +apt (0.9.7.5ubuntu4) UNRELEASED; urgency=low + + * apt-pkg/pkgcachegen.cc: + - Fix crash if the cache is remapped while writing a Provides version + (LP: #1066445). + + -- Colin Watson <cjwatson@ubuntu.com> Sun, 14 Oct 2012 23:42:31 +0100 + apt (0.9.7.5ubuntu3) quantal-proposed; urgency=low * Refresh translations from Launchpad. Amongst other fixes, this drops the |