OSDN Git Service
(root)
/
android-x86
/
bionic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e07558f
)
fix PTRDIFF_MAX check in the 32-bit mmap wrapper
author
Daniel Micay
<danielmicay@gmail.com>
Tue, 3 Nov 2015 10:30:29 +0000
(
05:30
-0500)
committer
Daniel Micay
<danielmicay@gmail.com>
Tue, 3 Nov 2015 10:30:29 +0000
(
05:30
-0500)
It wasn't making use of the page-rounded size.
Change-Id: I911345fcfd6419a4dbc18a4622b42e1b76729abb
libc/bionic/mmap.cpp
patch
|
blob
|
history
diff --git
a/libc/bionic/mmap.cpp
b/libc/bionic/mmap.cpp
index
794f50f
..
9bc80a2
100644
(file)
--- a/
libc/bionic/mmap.cpp
+++ b/
libc/bionic/mmap.cpp
@@
-48,7
+48,7
@@
void* mmap64(void* addr, size_t size, int prot, int flags, int fd, off64_t offse
// prevent allocations large enough for `end - start` to overflow
size_t rounded = BIONIC_ALIGN(size, PAGE_SIZE);
- if (rounded < size ||
size
> PTRDIFF_MAX) {
+ if (rounded < size ||
rounded
> PTRDIFF_MAX) {
errno = ENOMEM;
return MAP_FAILED;
}