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

Commit d74ed964 authored by Ivan Lozano's avatar Ivan Lozano Committed by android-build-merger
Browse files

Merge "Fix temporary file name strlcpy size." am: d4d542e0

am: 02d370c4

Change-Id: If6efd949c11a39c4df2ed753c6b850785f8872e4
parents 663150a7 02d370c4
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -236,17 +236,15 @@ copyFileIfChanged(JNIEnv *env, void* arg, ZipFileRO* zipFile, ZipEntryRO zipEntr
        return INSTALL_SUCCEEDED;
    }

    char localTmpFileName[nativeLibPath.size() + TMP_FILE_PATTERN_LEN + 2];
    char localTmpFileName[nativeLibPath.size() + TMP_FILE_PATTERN_LEN + 1];
    if (strlcpy(localTmpFileName, nativeLibPath.c_str(), sizeof(localTmpFileName))
            != nativeLibPath.size()) {
        ALOGD("Couldn't allocate local file name for library");
        return INSTALL_FAILED_INTERNAL_ERROR;
    }

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

    if (strlcpy(localTmpFileName + nativeLibPath.size(), TMP_FILE_PATTERN,
                    TMP_FILE_PATTERN_LEN - nativeLibPath.size()) != TMP_FILE_PATTERN_LEN) {
                    TMP_FILE_PATTERN_LEN + 1) != TMP_FILE_PATTERN_LEN) {
        ALOGI("Couldn't allocate temporary file name for library");
        return INSTALL_FAILED_INTERNAL_ERROR;
    }