diff options
author | Arch Librarian <arch@canonical.com> | 2004-09-20 16:54:20 +0000 |
---|---|---|
committer | Arch Librarian <arch@canonical.com> | 2004-09-20 16:54:20 +0000 |
commit | 470773ca75ff6883599e9439c703f3aec43b616c (patch) | |
tree | 02018d245556cbdc14f3bc9dba0e03b3044fbb0b /apt-pkg | |
parent | 50582e402ca913ec2dd9d472dd6ef0536098fa72 (diff) |
Small range check bug
Author: jgg
Date: 1999-07-18 05:58:40 GMT
Small range check bug
Diffstat (limited to 'apt-pkg')
-rw-r--r-- | apt-pkg/contrib/mmap.cc | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/apt-pkg/contrib/mmap.cc b/apt-pkg/contrib/mmap.cc index 098c61ca6..850e1046a 100644 --- a/apt-pkg/contrib/mmap.cc +++ b/apt-pkg/contrib/mmap.cc @@ -1,6 +1,6 @@ // -*- mode: cpp; mode: fold -*- // Description /*{{{*/ -// $Id: mmap.cc,v 1.15 1999/04/18 06:36:36 jgg Exp $ +// $Id: mmap.cc,v 1.16 1999/07/18 05:58:40 jgg Exp $ /* ###################################################################### MMap Class - Provides 'real' mmap or a faked mmap using read(). @@ -206,6 +206,7 @@ unsigned long DynamicMMap::RawAllocate(unsigned long Size,unsigned long Aln) _error->Error("Dynamic MMap ran out of room"); return 0; } + return Result; } /*}}}*/ @@ -250,7 +251,7 @@ unsigned long DynamicMMap::Allocate(unsigned long ItemSize) I->Count--; unsigned long Result = I->Start; - I->Start += ItemSize; + I->Start += ItemSize; return Result/ItemSize; } /*}}}*/ @@ -262,7 +263,7 @@ unsigned long DynamicMMap::WriteString(const char *String, { unsigned long Result = iSize; // Just in case error check - if (Result > WorkSpace) + if (Result + Len > WorkSpace) { _error->Error("Dynamic MMap ran out of room"); return 0; |