diff options
Diffstat (limited to 'libs/androidfw/ApkParsing.cpp')
-rw-r--r-- | libs/androidfw/ApkParsing.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/libs/androidfw/ApkParsing.cpp b/libs/androidfw/ApkParsing.cpp index cf4fbb9b8462..32d2c5b05acb 100644 --- a/libs/androidfw/ApkParsing.cpp +++ b/libs/androidfw/ApkParsing.cpp @@ -56,10 +56,8 @@ const char* ValidLibraryPathLastSlash(const char* fileName, bool suppress64Bit, return nullptr; } - // Make sure there aren't subdirectories - const char* abiOffset = fileName + APK_LIB_LEN; - const size_t abiSize = lastSlash - abiOffset; - if (memchr(abiOffset, '/', abiSize)) { + // Make sure there aren't subdirectories by checking if the next / after lib/ is the last slash + if (memchr(fileName + APK_LIB_LEN, '/', fileNameLen - APK_LIB_LEN) != lastSlash) { return nullptr; } |