diff options
author | Julian Andres Klode <jak@debian.org> | 2012-06-16 14:38:09 +0200 |
---|---|---|
committer | Julian Andres Klode <jak@debian.org> | 2012-06-16 14:38:09 +0200 |
commit | 61a406f0fc9c7b1807acb2ff146db6acd18e879c (patch) | |
tree | 8e3f2b9534c219fd0ddf645ba852067e7061194f /apt-pkg/contrib | |
parent | 7899a1339ced1e8fa10730e5619349b9fd782fac (diff) |
Zero out the new memory allocated with realloc().
Diffstat (limited to 'apt-pkg/contrib')
-rw-r--r-- | apt-pkg/contrib/mmap.cc | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/apt-pkg/contrib/mmap.cc b/apt-pkg/contrib/mmap.cc index 131cefd6e..77b4502f5 100644 --- a/apt-pkg/contrib/mmap.cc +++ b/apt-pkg/contrib/mmap.cc @@ -461,6 +461,8 @@ bool DynamicMMap::Grow() { return false; Base = realloc(Base, newSize); + /* Set new memory to 0 */ + memset((char*)Base + WorkSpace, 0, newSize - WorkSpace); if (Base == NULL) return false; } |