summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2012-10-15 16:00:44 +0200
committerMichael Vogt <michael.vogt@ubuntu.com>2012-10-15 16:00:44 +0200
commit27cae7715489c13c504590cf77a6d22680dbe0b1 (patch)
tree7d5b13103d19917101f67ed41c8264de440dd726
parent5caefc9115860e1bc1fdff8971a9e45f96a1c4e5 (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.cc8
-rw-r--r--debian/changelog5
2 files changed, 11 insertions, 2 deletions
diff --git a/apt-pkg/pkgcachegen.cc b/apt-pkg/pkgcachegen.cc
index 739b538c6..373f6625c 100644
--- a/apt-pkg/pkgcachegen.cc
+++ b/apt-pkg/pkgcachegen.cc
@@ -975,8 +975,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 1fd2e8936..f83d661a7 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -33,6 +33,11 @@ apt (0.9.7.6) UNRELEASED; urgency=low
* increase the maximum netrc login/password size and show proper
error message on overflow
+ [ Colin Watson ]
+ * apt-pkg/pkgcachegen.cc:
+ - Fix crash if the cache is remapped while writing a Provides version
+ (LP: #1066445).
+
-- David Kalnischkies <kalnischkies@gmail.com> Wed, 19 Sep 2012 11:29:56 +0200
apt (0.9.7.5) unstable; urgency=low