summaryrefslogtreecommitdiff
path: root/apt-pkg/contrib/mmap.cc
diff options
context:
space:
mode:
authorDavid Kalnischkies <kalnischkies@gmail.com>2012-05-21 19:12:25 +0200
committerDavid Kalnischkies <kalnischkies@gmail.com>2012-05-21 19:12:25 +0200
commit6bae2c5108a95267fedcc8f2312e91488ebece8d (patch)
tree7acfa39bce6588b78ec347b3ea7ee398037159fb /apt-pkg/contrib/mmap.cc
parent65bf851838611139239805bee63a7cea4cb0a309 (diff)
* 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)
Diffstat (limited to 'apt-pkg/contrib/mmap.cc')
-rw-r--r--apt-pkg/contrib/mmap.cc1
1 files changed, 1 insertions, 0 deletions
diff --git a/apt-pkg/contrib/mmap.cc b/apt-pkg/contrib/mmap.cc
index 160718ea5..2d12b6fe9 100644
--- a/apt-pkg/contrib/mmap.cc
+++ b/apt-pkg/contrib/mmap.cc
@@ -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;