topjohnwu 528601d25a Fix integer overflow and workaround seccomp
- Use ftruncate64 instead of ftruncate to workaround seccomp
- Cast uint32_t to off64_t before making it negative

Note: Using ftruncate with a modern NDK libc should actually be
fine as the syscall wrapper in bionic will use ftruncate64 internally.
However, since we are using the libc.a from r10e built for Gingerbread,
seccomp wasn't a thing back then, and also the ftruncate64 symbol is
missing; we have to create our own wrapper and call it instead on
32-bit ABIs.

Props to @jnotuo for discovering the overflow bug and seccomp issue

Fix #3703, close #4915
2021-11-10 03:07:20 -08:00
..
2021-10-31 10:52:12 -07:00
2021-11-03 22:22:29 -07:00
2020-03-09 01:50:30 -07:00
2021-08-13 04:53:11 -07:00
2021-08-13 04:53:11 -07:00
2021-11-03 22:21:48 -07:00
2021-03-02 20:37:37 -08:00
2021-08-28 17:16:20 -07:00
2021-08-28 17:16:20 -07:00
2021-02-28 14:37:12 -08:00