• topjohnwu's avatar
    Fix integer overflow and workaround seccomp · 528601d2
    topjohnwu authored
    - 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
    528601d2
Name
Last commit
Last update
.github Loading commit data...
app Loading commit data...
buildSrc Loading commit data...
docs Loading commit data...
gradle/wrapper Loading commit data...
native Loading commit data...
scripts Loading commit data...
stub Loading commit data...
tools Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
.gitmodules Loading commit data...
LICENSE Loading commit data...
README.MD Loading commit data...
build.gradle.kts Loading commit data...
build.py Loading commit data...
config.prop.sample Loading commit data...
gradle.properties Loading commit data...
gradlew Loading commit data...
gradlew.bat Loading commit data...
settings.gradle.kts Loading commit data...