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

Commit 9c0804bb authored by Andreas Huber's avatar Andreas Huber Committed by android-build-merger
Browse files

Fix use-after-free of stack-allocated temporary string. am: c41b838b am: a5efddda

am: dbd2ac12

Change-Id: I3afd60abcb45a9ae39388630edb274b8eca3ecc1
parents 25e0085c dbd2ac12
Loading
Loading
Loading
Loading
+3 −1
Original line number Original line Diff line number Diff line
@@ -295,13 +295,15 @@ bool LoadSplitPolicy() {
        return false;
        return false;
    }
    }
    std::string mapping_file("/system/etc/selinux/mapping/" + vend_plat_vers + ".cil");
    std::string mapping_file("/system/etc/selinux/mapping/" + vend_plat_vers + ".cil");
    const std::string version_as_string = std::to_string(max_policy_version);

    // clang-format off
    // clang-format off
    const char* compile_args[] = {
    const char* compile_args[] = {
        "/system/bin/secilc",
        "/system/bin/secilc",
        plat_policy_cil_file,
        plat_policy_cil_file,
        "-M", "true", "-G", "-N",
        "-M", "true", "-G", "-N",
        // Target the highest policy language version supported by the kernel
        // Target the highest policy language version supported by the kernel
        "-c", std::to_string(max_policy_version).c_str(),
        "-c", version_as_string.c_str(),
        mapping_file.c_str(),
        mapping_file.c_str(),
        "/vendor/etc/selinux/nonplat_sepolicy.cil",
        "/vendor/etc/selinux/nonplat_sepolicy.cil",
        "-o", compiled_sepolicy,
        "-o", compiled_sepolicy,