Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 77274269 authored by Andreas Gampe's avatar Andreas Gampe Committed by android-build-merger
Browse files

Merge "NativeLibraryHelper: Minor fixes" am: c1536f0d

am: 109a82d7

Change-Id: I362df209d24a9e2602da1b8cf72e4ea63b5e7f60
parents bab9a7e6 109a82d7
Loading
Loading
Loading
Loading
+6 −1
Original line number Original line Diff line number Diff line
@@ -243,7 +243,7 @@ copyFileIfChanged(JNIEnv *env, void* arg, ZipFileRO* zipFile, ZipEntryRO zipEntr
        return INSTALL_FAILED_INTERNAL_ERROR;
        return INSTALL_FAILED_INTERNAL_ERROR;
    }
    }


    *(localFileName + nativeLibPath.size()) = '/';
    *(localTmpFileName + nativeLibPath.size()) = '/';


    if (strlcpy(localTmpFileName + nativeLibPath.size(), TMP_FILE_PATTERN,
    if (strlcpy(localTmpFileName + nativeLibPath.size(), TMP_FILE_PATTERN,
                    TMP_FILE_PATTERN_LEN - nativeLibPath.size()) != TMP_FILE_PATTERN_LEN) {
                    TMP_FILE_PATTERN_LEN - nativeLibPath.size()) != TMP_FILE_PATTERN_LEN) {
@@ -344,6 +344,11 @@ public:
            const char* lastSlash = strrchr(fileName, '/');
            const char* lastSlash = strrchr(fileName, '/');
            ALOG_ASSERT(lastSlash != NULL, "last slash was null somehow for %s\n", fileName);
            ALOG_ASSERT(lastSlash != NULL, "last slash was null somehow for %s\n", fileName);


            // Skip directories.
            if (*(lastSlash + 1) == 0) {
                continue;
            }

            // Make sure the filename is safe.
            // Make sure the filename is safe.
            if (!isFilenameSafe(lastSlash + 1)) {
            if (!isFilenameSafe(lastSlash + 1)) {
                continue;
                continue;