Skip to content

Commit 0c8844e

Browse files
authored
Fix missing null terminator when calling execv() on modprobe (#13054)
1 parent c3264b7 commit 0c8844e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/linux/init/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3383,7 +3383,7 @@ try
33833383
const std::string KernelModulesList = wsl::shared::string::FromSpan(Buffer, EarlyConfig->KernelModulesListOffset);
33843384
for (const auto& Module : wsl::shared::string::Split(KernelModulesList, ','))
33853385
{
3386-
const char* Argv[] = {MODPROBE_PATH, Module.c_str()};
3386+
const char* Argv[] = {MODPROBE_PATH, Module.c_str(), nullptr};
33873387
int Status = -1;
33883388
auto result = UtilCreateProcessAndWait(MODPROBE_PATH, Argv, &Status);
33893389
if (result < 0)

src/linux/init/util.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -682,7 +682,7 @@ Return Value:
682682
// 2. In sometime we probably will replace most of these string constants
683683
// with std::string anyway.
684684
execv(File, const_cast<char* const*>(Argv));
685-
LOG_ERROR("{} failed with {}", File, errno);
685+
LOG_ERROR("execv({}) failed with {}", File, errno);
686686
exit(-1);
687687
}
688688

0 commit comments

Comments
 (0)