diff options
author | Jeff Johnston <jjohnstn@redhat.com> | 2009-04-03 22:42:31 +0000 |
---|---|---|
committer | Jeff Johnston <jjohnstn@redhat.com> | 2009-04-03 22:42:31 +0000 |
commit | 0463fc624cb42dd2b766ea02b65a62abbf0a59ad (patch) | |
tree | 0df87702fc3666da0addaf77f2166de27e47776e /newlib/libc/machine/spu/mmap_ea.c | |
parent | d65c75640ecb816238ab9fe4fd830b5e142eecb7 (diff) | |
download | cygnal-0463fc624cb42dd2b766ea02b65a62abbf0a59ad.tar.gz cygnal-0463fc624cb42dd2b766ea02b65a62abbf0a59ad.tar.bz2 cygnal-0463fc624cb42dd2b766ea02b65a62abbf0a59ad.zip |
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/spu/mmap_ea.c')
-rw-r--r-- | newlib/libc/machine/spu/mmap_ea.c | 9 |
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; /* |