aboutsummaryrefslogtreecommitdiffstats
path: root/main/musl/0001-posix_spawn-use-larger-stack-to-cover-worst-case-in-.patch
diff options
context:
space:
mode:
Diffstat (limited to 'main/musl/0001-posix_spawn-use-larger-stack-to-cover-worst-case-in-.patch')
-rw-r--r--main/musl/0001-posix_spawn-use-larger-stack-to-cover-worst-case-in-.patch32
1 files changed, 32 insertions, 0 deletions
diff --git a/main/musl/0001-posix_spawn-use-larger-stack-to-cover-worst-case-in-.patch b/main/musl/0001-posix_spawn-use-larger-stack-to-cover-worst-case-in-.patch
new file mode 100644
index 0000000000..0ff9084861
--- /dev/null
+++ b/main/musl/0001-posix_spawn-use-larger-stack-to-cover-worst-case-in-.patch
@@ -0,0 +1,32 @@
+From 9b5ca541b2c97850b00a051ad21efc46792b91b2 Mon Sep 17 00:00:00 2001
+From: Will Dietz <w@wdtz.org>
+Date: Thu, 14 Sep 2017 16:32:59 -0500
+Subject: [PATCH] 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.
+---
+ src/process/posix_spawn.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/process/posix_spawn.c b/src/process/posix_spawn.c
+index ea5d2998..0849c71f 100644
+--- a/src/process/posix_spawn.c
++++ b/src/process/posix_spawn.c
+@@ -152,7 +152,7 @@ int __posix_spawnx(pid_t *restrict res, const char *restrict path,
+ char *const argv[restrict], char *const envp[restrict])
+ {
+ pid_t pid;
+- char stack[1024];
++ char stack[1024+PATH_MAX];
+ int ec=0, cs;
+ struct args args;
+
+--
+2.14.1