From e873e1d31b1e43e9c3b95a5e40fec905a0dc78dc Mon Sep 17 00:00:00 2001 From: Jiyong Park Date: Sat, 20 Apr 2024 10:11:46 +0900 Subject: [PATCH] Null terminate the std::array given to execve std::array takes exactly N * sizeof(T) bytes, leaving no room for the null terminator. Bug: 335047945 Test: re-run the GSI test Change-Id: Ic3aca5f409021c78a7eb965c5ed610e6a51e42cb --- init/first_stage_mount.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/init/first_stage_mount.cpp b/init/first_stage_mount.cpp index ae216c664..5d3a27354 100644 --- a/init/first_stage_mount.cpp +++ b/init/first_stage_mount.cpp @@ -556,11 +556,11 @@ static bool MaybeDeriveMicrodroidVendorDiceNode(Fstab* fstab) { return true; } // clang-format off - const std::array args = { + const std::array args = { "/system/bin/derive_microdroid_vendor_dice_node", "--dice-driver", "/dev/open-dice0", "--microdroid-vendor-disk-image", microdroid_vendor_block_dev->data(), - "--output", "/microdroid_resources/dice_chain.raw", + "--output", "/microdroid_resources/dice_chain.raw", nullptr, }; // clang-format-on // ForkExecveAndWaitForCompletion calls waitpid to wait for the fork-ed process to finish.