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

Commit f5e04646 authored by Andreas Huber's avatar Andreas Huber
Browse files

Fix use-after-free of stack-allocated temporary string.

Bug: 64848081
Test: built and successfully booted again
Merged-In: I93c899249bf2cc5ab8d880c0eaff471518e73121

Change-Id: I93c899249bf2cc5ab8d880c0eaff471518e73121
parent e67c7b94
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -277,13 +277,15 @@ bool LoadSplitPolicy() {
        return false;
    }

    const std::string version_as_string = std::to_string(max_policy_version);

    // clang-format off
    const char* compile_args[] = {
        "/system/bin/secilc",
        plat_policy_cil_file,
        "-M", "true",
        // 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(),
        "/system/etc/selinux/mapping_sepolicy.cil",
        "/vendor/etc/selinux/nonplat_sepolicy.cil",
        "-o", compiled_sepolicy,