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:
authorCorinna Vinschen <corinna@vinschen.de>2001-11-05 23:58:22 +0300
committerCorinna Vinschen <corinna@vinschen.de>2001-11-05 23:58:22 +0300
commit910e57ec840e03fcbe945ee197598268ba69ed3f (patch)
treede4636cc13a11d1dc62aaf54051d13fc86ded0ae /winsup/cygwin/mmap.cc
parentc7dd4f95118f40d8fcb2f83c11d9419aba5bdef2 (diff)
* mmap.cc (mmap_record::find_empty): Add input parameter check.
Diffstat (limited to 'winsup/cygwin/mmap.cc')
-rw-r--r--winsup/cygwin/mmap.cc2
1 files changed, 2 insertions, 0 deletions
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))
{