From 95ec0f241f9fb7fd6c4bc9d378de651f4bded0ad Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Tue, 28 Nov 2000 21:25:45 +0000 Subject: [PATCH] * mmap.cc (munmap): Check that mmap and munmap length match. --- winsup/cygwin/ChangeLog | 4 ++++ winsup/cygwin/mmap.cc | 5 ++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 5a10c65f7..8d2b7af42 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,7 @@ +Mon Nov 27 21:09:50 2000 Kelley Cook + + * mmap.cc (munmap): Check that mmap and munmap length match. + Tue Nov 28 18:08:00 2000 Corinna Vinschen * fhandler.cc (fhandler_disk_file::open): Check for buggy CreateFile 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);