Skip to content

Commit

Permalink
Merge branch 'opa334:2.x' into 2.x
Browse files Browse the repository at this point in the history
  • Loading branch information
wwg135 authored Feb 20, 2024
2 parents d22693d + 0058131 commit 2a5d9a4
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 2a5d9a4

Please sign in to comment.