Merge "fix PTRDIFF_MAX check in the 32-bit mmap wrapper"
am: af909869d8 * commit 'af909869d868585a47914ab51536192da50935cb': fix PTRDIFF_MAX check in the 32-bit mmap wrapper
This commit is contained in:
commit
a59479434c
@ -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
|
// prevent allocations large enough for `end - start` to overflow
|
||||||
size_t rounded = BIONIC_ALIGN(size, PAGE_SIZE);
|
size_t rounded = BIONIC_ALIGN(size, PAGE_SIZE);
|
||||||
if (rounded < size || size > PTRDIFF_MAX) {
|
if (rounded < size || rounded > PTRDIFF_MAX) {
|
||||||
errno = ENOMEM;
|
errno = ENOMEM;
|
||||||
return MAP_FAILED;
|
return MAP_FAILED;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user