* apt-pkg/pkgcachegen.cc:
authorMichael Vogt <michael.vogt@ubuntu.com>
Mon, 15 Oct 2012 14:00:44 +0000 (16:00 +0200)
committerMichael Vogt <michael.vogt@ubuntu.com>
Mon, 15 Oct 2012 14:00:44 +0000 (16:00 +0200)
  - Fix crash if the cache is remapped while writing a Provides version
    (LP: #1066445).

apt-pkg/pkgcachegen.cc
debian/changelog

index 739b538..373f662 100644 (file)
@@ -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;
index 1fd2e89..f83d661 100644 (file)
@@ -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