Skip to content

Commit

Permalink
Fix boomerang zombie processes
Browse files Browse the repository at this point in the history
  • Loading branch information
opa334 committed Feb 20, 2024
1 parent b6ed9ed commit 0058131
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions BaseBin/launchdhook/src/spawn_hook.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,13 @@ int posix_spawn_hook(pid_t *restrict pid, const char *restrict path,
if (stagedJailbreakUpdate) {
int r = jbupdate_basebin(stagedJailbreakUpdate);
unsetenv("STAGED_JAILBREAK_UPDATE");

// Update envp to reflect our changes
// setenv / unsetenv can sometimes cause environ to get reallocated
// In that case envp may point to garbage or be empty
envp = environ;
}

// Always use environ instead of envp, as boomerang_stashPrimitives calls setenv
// setenv / unsetenv can sometimes cause environ to get reallocated
// In that case envp may point to garbage or be empty
// Say goodbye to this process
return posix_spawn_orig_wrapper(pid, path, file_actions, attrp, argv, envp);
return posix_spawn_orig_wrapper(pid, path, file_actions, attrp, argv, environ);
}
}

Expand Down

0 comments on commit 0058131

Please sign in to comment.