From 910e57ec840e03fcbe945ee197598268ba69ed3f Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Mon, 5 Nov 2001 20:58:22 +0000 Subject: [PATCH] * mmap.cc (mmap_record::find_empty): Add input parameter check. --- winsup/cygwin/ChangeLog | 4 ++++ winsup/cygwin/mmap.cc | 2 ++ 2 files changed, 6 insertions(+) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 1949c5af3..681b809c4 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,7 @@ +2001-11-05 Corinna Vinschen + + * mmap.cc (mmap_record::find_empty): Add input parameter check. + 2001-11-04 Christopher Faylor * dtable.cc (dtable::build_fhandler): Fix debug_printf to avoid SEGV diff --git a/winsup/cygwin/mmap.cc b/winsup/cygwin/mmap.cc index ab36a5234..884941ae4 100644 --- a/winsup/cygwin/mmap.cc +++ b/winsup/cygwin/mmap.cc @@ -109,6 +109,8 @@ mmap_record::find_empty (DWORD pages) DWORD mapped_pages = PAGE_CNT (size_to_map_); DWORD start; + if (pages > mapped_pages) + return (DWORD)-1; for (start = 0; start <= mapped_pages - pages; ++start) if (!MAP_ISSET (start)) {