From 6bae2c5108a95267fedcc8f2312e91488ebece8d Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Mon, 21 May 2012 19:12:25 +0200 Subject: =?UTF-8?q?*=20apt-pkg/contrib/mmap.cc:=20=20=20-=20have=20a=20dum?= =?UTF-8?q?my=20SyncToFd=20around=20in=20case=20of=20ReadOnly=20access=20t?= =?UTF-8?q?o=20a=20=20=20=20=20compressed=20file=20as=20we=20otherwise=20o?= =?UTF-8?q?n=20Close()=20do=20not=20delete[]=20the=20=20=20=20=20char=20bu?= =?UTF-8?q?ffer=20but=20munmap()=20it=E2=80=A6=20(Closes:=20#673815)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apt-pkg/contrib/mmap.cc | 1 + debian/changelog | 4 ++++ 2 files changed, 5 insertions(+) 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; diff --git a/debian/changelog b/debian/changelog index b23232c7b..1b58bcd29 100644 --- a/debian/changelog +++ b/debian/changelog @@ -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 Mon, 21 May 2012 15:10:49 +0200 -- cgit v1.2.3