2009-04-03 Ken Werner <ken.werner@de.ibm.com>

* libc/machine/spu/mmap_ea.c (mmap_ea): Check length argument.
This commit is contained in:
Jeff Johnston 2009-04-03 22:42:31 +00:00
parent d65c75640e
commit 0463fc624c
2 changed files with 11 additions and 2 deletions

View File

@ -1,3 +1,7 @@
2009-04-03 Ken Werner <ken.werner@de.ibm.com>
* libc/machine/spu/mmap_ea.c (mmap_ea): Check length argument.
2009-04-03 Ken Werner <ken.werner@de.ibm.com>
* libc/machine/spu/sys/linux_syscalls.h: include <sys/types.h>

View File

@ -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;
/*