commit | af909869d868585a47914ab51536192da50935cb | [log] [tgz] |
---|---|---|
author | Josh Gao <jmgao@google.com> | Tue Nov 03 19:35:05 2015 +0000 |
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | Tue Nov 03 19:35:05 2015 +0000 |
tree | 6639e7bfff39c3dc48e4cee8caf7b1abb4407997 | |
parent | 9fe02f3e3ca382aa95fa93ce73a49a5c1141efb1 [diff] | |
parent | 706186d266d45c161f9dad3ec1851c78017bc1de [diff] |
Merge "fix PTRDIFF_MAX check in the 32-bit mmap wrapper"
diff --git a/libc/bionic/mmap.cpp b/libc/bionic/mmap.cpp index 794f50f..9bc80a2 100644 --- a/libc/bionic/mmap.cpp +++ b/libc/bionic/mmap.cpp
@@ -48,7 +48,7 @@ // 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; }