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:
authorJeff Johnston <jjohnstn@redhat.com>2009-04-04 02:42:31 +0400
committerJeff Johnston <jjohnstn@redhat.com>2009-04-04 02:42:31 +0400
commit0463fc624cb42dd2b766ea02b65a62abbf0a59ad (patch)
tree0df87702fc3666da0addaf77f2166de27e47776e /newlib/libc/machine
parentd65c75640ecb816238ab9fe4fd830b5e142eecb7 (diff)
2009-04-03 Ken Werner <ken.werner@de.ibm.com>
* libc/machine/spu/mmap_ea.c (mmap_ea): Check length argument.
Diffstat (limited to 'newlib/libc/machine')
-rw-r--r--newlib/libc/machine/spu/mmap_ea.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/newlib/libc/machine/spu/mmap_ea.c b/newlib/libc/machine/spu/mmap_ea.c
index 4097fc007..0b4a5d8b4 100644
--- a/newlib/libc/machine/spu/mmap_ea.c
+++ b/newlib/libc/machine/spu/mmap_ea.c
@@ -41,8 +41,13 @@ __ea void *mmap_ea (__ea void *start, size_ea_t length, int prot, int
flags, int fd, off_t offset)
{
#ifdef __EA64__
- return (__ea void *) mmap_eaddr ((unsigned long long) start, length,
- prot, flags, fd, offset);
+ if (length > 0xffffffffULL) {
+ errno = ENOMEM;
+ return MAP_FAILED_EADDR;
+ } else {
+ return (__ea void *) mmap_eaddr ((unsigned long long) start,
+ (size_t) length, prot, flags, fd, offset);
+ }
#else /* __EA32__ */
unsigned long long res;
/*