commit | 99868904feeac944a0d482a2994f9d7b6828bff2 | [log] [tgz] |
---|---|---|
author | Elliott Hughes <enh@google.com> | Fri Dec 20 18:17:34 2013 -0800 |
committer | Elliott Hughes <enh@google.com> | Fri Dec 20 18:17:34 2013 -0800 |
tree | 1f630430195de631470350904561211cc5e3a8c8 | |
parent | 22323f91b11b0fbaa0a101a75e116132028a5817 [diff] [blame] |
Avoid sign extension in 32-bit mmap. Change-Id: I2a77925f62f381a0b34648c3db8154a55dd80c46
diff --git a/libc/bionic/mmap.cpp b/libc/bionic/mmap.cpp index 75bea58..84a0f76 100644 --- a/libc/bionic/mmap.cpp +++ b/libc/bionic/mmap.cpp
@@ -55,5 +55,5 @@ } void* mmap(void* addr, size_t size, int prot, int flags, int fd, off_t offset) { - return mmap64(addr, size, prot, flags, fd, static_cast<off64_t>(offset)); + return mmap64(addr, size, prot, flags, fd, static_cast<off64_t>(offset) & 0xffffffff); }