Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2000-11-29 00:25:45 +0300
committerChristopher Faylor <me@cgf.cx>2000-11-29 00:25:45 +0300
commit95ec0f241f9fb7fd6c4bc9d378de651f4bded0ad (patch)
tree8fa0bf18eba339a0104c80c78cb43824cffbbc1c /winsup/cygwin/mmap.cc
parente1a993d549f9f3047d31de7aeeaa0f49efdb738b (diff)
* mmap.cc (munmap): Check that mmap and munmap length match.
Diffstat (limited to 'winsup/cygwin/mmap.cc')
-rw-r--r--winsup/cygwin/mmap.cc5
1 files changed, 2 insertions, 3 deletions
diff --git a/winsup/cygwin/mmap.cc b/winsup/cygwin/mmap.cc
index cfd0a0f7f..4de9eb245 100644
--- a/winsup/cygwin/mmap.cc
+++ b/winsup/cygwin/mmap.cc
@@ -288,11 +288,10 @@ munmap (caddr_t addr, size_t len)
list *l = mmapped_areas->lists[it];
if (l != 0)
{
- int li;
- for (li = 0; li < l->nrecs; ++li)
+ for (int li = 0; li < l->nrecs; ++li)
{
mmap_record rec = l->recs[li];
- if (rec.get_address () == addr)
+ if (rec.get_address () == addr && rec.get_size () == len)
{
int fd = l->fd;
fhandler_disk_file fh_paging_file (NULL);