]> git.saurik.com Git - apt.git/commitdiff
* apt-pkg/contrib/mmap.cc:
authorDavid Kalnischkies <kalnischkies@gmail.com>
Mon, 21 May 2012 17:12:25 +0000 (19:12 +0200)
committerDavid Kalnischkies <kalnischkies@gmail.com>
Mon, 21 May 2012 17:12:25 +0000 (19:12 +0200)
  - have a dummy SyncToFd around in case of ReadOnly access to a
    compressed file as we otherwise on Close() do not delete[] the
    char buffer but munmap() it… (Closes: #673815)

apt-pkg/contrib/mmap.cc
debian/changelog

index 160718ea5ae503caf1848afd63514fbeae0d9a4d..2d12b6fe9091417440d5769a6dbe4839e8e795db 100644 (file)
@@ -84,6 +84,7 @@ bool MMap::Map(FileFd &Fd)
       if ((Flags & ReadOnly) != ReadOnly)
         return _error->Error("Compressed file %s can only be mapped readonly", Fd.Name().c_str());
       Base = new unsigned char[iSize];
+      SyncToFd = new FileFd();
       if (Fd.Seek(0L) == false || Fd.Read(Base, iSize) == false)
         return _error->Error("Compressed file %s can't be read into mmap", Fd.Name().c_str());
       return true;
index b23232c7b1a81e76de3b98ba6e7d1e967d08fafa..1b58bcd2929c353f82cbc362ecefb744f5bd35ad 100644 (file)
@@ -7,6 +7,10 @@ apt (0.9.5) UNRELEASED; urgency=low
   * buildlib/inttypes.h.in:
     - remove inttypes.h compatibility as providing such a c99 types
       compatibility conflicts with the usage of c99 type long long
+  * apt-pkg/contrib/mmap.cc:
+    - have a dummy SyncToFd around in case of ReadOnly access to a
+      compressed file as we otherwise on Close() do not delete[] the
+      char buffer but munmap() it… (Closes: #673815)
 
  -- David Kalnischkies <kalnischkies@gmail.com>  Mon, 21 May 2012 15:10:49 +0200