[devel] [PATCH for apt 29/38] Fix off by one error in dynamic mmap leading to resource leak
Aleksei Nikiforov
darktemplar на altlinux.org
Вт Дек 10 18:23:34 MSK 2019
---
apt/apt-pkg/contrib/mmap.cc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/apt/apt-pkg/contrib/mmap.cc b/apt/apt-pkg/contrib/mmap.cc
index a3b06cc..83bf402 100644
--- a/apt/apt-pkg/contrib/mmap.cc
+++ b/apt/apt-pkg/contrib/mmap.cc
@@ -166,7 +166,7 @@ DynamicMMap::DynamicMMap(FileFd &F,unsigned long Flags,unsigned long long WorkSp
WorkSpace = EndOfFile;
else
{
- Fd->Seek(WorkSpace);
+ Fd->Seek(WorkSpace - 1);
char C = 0;
Fd->Write(&C,sizeof(C));
}
--
2.24.0
Подробная информация о списке рассылки Devel