mirror of
https://github.com/microsoft/WSL.git
synced 2025-12-10 00:44:55 -06:00
Fix missing null terminator when calling execv() on modprobe (#13054)
This commit is contained in:
parent
c3264b73f5
commit
0c8844e0f2
@ -3383,7 +3383,7 @@ try
|
||||
const std::string KernelModulesList = wsl::shared::string::FromSpan(Buffer, EarlyConfig->KernelModulesListOffset);
|
||||
for (const auto& Module : wsl::shared::string::Split(KernelModulesList, ','))
|
||||
{
|
||||
const char* Argv[] = {MODPROBE_PATH, Module.c_str()};
|
||||
const char* Argv[] = {MODPROBE_PATH, Module.c_str(), nullptr};
|
||||
int Status = -1;
|
||||
auto result = UtilCreateProcessAndWait(MODPROBE_PATH, Argv, &Status);
|
||||
if (result < 0)
|
||||
|
||||
@ -682,7 +682,7 @@ Return Value:
|
||||
// 2. In sometime we probably will replace most of these string constants
|
||||
// with std::string anyway.
|
||||
execv(File, const_cast<char* const*>(Argv));
|
||||
LOG_ERROR("{} failed with {}", File, errno);
|
||||
LOG_ERROR("execv({}) failed with {}", File, errno);
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user