diff options
Diffstat (limited to 'main/musl/0004-fix-new-environment-always-being-null-with-execle.patch')
-rw-r--r-- | main/musl/0004-fix-new-environment-always-being-null-with-execle.patch | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/main/musl/0004-fix-new-environment-always-being-null-with-execle.patch b/main/musl/0004-fix-new-environment-always-being-null-with-execle.patch new file mode 100644 index 000000000..31a1672e2 --- /dev/null +++ b/main/musl/0004-fix-new-environment-always-being-null-with-execle.patch @@ -0,0 +1,36 @@ +From 2b2aff37aced66e4a50a38a14607a9b1dc0ee001 Mon Sep 17 00:00:00 2001 +From: Rich Felker <dalias@aerifal.cx> +Date: Thu, 3 Oct 2013 10:16:01 -0400 +Subject: [PATCH] fix new environment always being null with execle +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +the va_arg call for the argv[]-terminating null pointer was missing, +so this pointer was being wrongly used as the environment pointer. + +issue reported by Timo Teräs. proposed patch slightly modified to +simplify the resulting code. +--- + src/process/execle.c | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/src/process/execle.c b/src/process/execle.c +index 6490836..6f2ec05 100644 +--- a/src/process/execle.c ++++ b/src/process/execle.c +@@ -14,9 +14,8 @@ int execle(const char *path, const char *argv0, ...) + char **envp; + va_start(ap, argv0); + argv[0] = (char *)argv0; +- for (i=1; i<argc; i++) ++ for (i=1; i<=argc; i++) + argv[i] = va_arg(ap, char *); +- argv[i] = NULL; + envp = va_arg(ap, char **); + return execve(path, argv, envp); + } +-- +1.8.4 + + |