mirror of
https://git.musl-libc.org/git/musl
synced 2025-03-20 01:22:54 +03:00
posix_spawn: use larger stack to cover worst-case in execvpe
execvpe stack-allocates a buffer used to hold the full path (combination of a PATH entry and the program name) while searching through $PATH, so at least NAME_MAX+PATH_MAX is needed. The stack size can be made conditionally smaller (the current 1024 appears appropriate) should this larger size be burdensome in those situations.
This commit is contained in:
parent
2cd663fb2d
commit
004dc9549b
@ -152,7 +152,7 @@ int __posix_spawnx(pid_t *restrict res, const char *restrict path,
|
|||||||
char *const argv[restrict], char *const envp[restrict])
|
char *const argv[restrict], char *const envp[restrict])
|
||||||
{
|
{
|
||||||
pid_t pid;
|
pid_t pid;
|
||||||
char stack[1024];
|
char stack[1024+PATH_MAX];
|
||||||
int ec=0, cs;
|
int ec=0, cs;
|
||||||
struct args args;
|
struct args args;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user