Skip to content

Commit

Permalink
Fix issue 24824 - ensure we exit a child that does not succeed in exec.
Browse files Browse the repository at this point in the history
  • Loading branch information
schveiguy committed Oct 22, 2024
1 parent cd02612 commit a196e22
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions std/process.d
Original file line number Diff line number Diff line change
Expand Up @@ -4525,11 +4525,12 @@ else version (Posix)
if (childpid == 0)
{
// Trusted because args and all entries are always zero-terminated
(() @trusted =>
core.sys.posix.unistd.execvp(args[0], &args[0]) ||
perror(args[0]) // failed to execute
)();
return;
(() @trusted {
core.sys.posix.unistd.execvp(args[0], &args[0]);
perror(args[0]);
core.sys.posix.unistd._exit(1);
})();
assert(0, "Child failed to exec");
}
if (browser)
// Trusted because it's allocated via strdup above
Expand Down

0 comments on commit a196e22

Please sign in to comment.