From daca80f1cb25735ff992ecf87ab67c29e7bed98b Mon Sep 17 00:00:00 2001 From: Joris Vink Date: Sun, 20 Feb 2022 21:20:14 +0100 Subject: [PATCH] execve() its envp shouldn't be NULL. --- src/python.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/python.c b/src/python.c index 33cd259..cec6a83 100644 --- a/src/python.c +++ b/src/python.c @@ -2664,7 +2664,7 @@ python_kore_proc(PyObject *self, PyObject *args) { const char *cmd; struct pyproc *proc; - char *copy, *argv[32]; + char *copy, *argv[32], *env[1]; int timeo, in_pipe[2], out_pipe[2]; timeo = -1; @@ -2734,9 +2734,11 @@ python_kore_proc(PyObject *self, PyObject *args) dup2(in_pipe[0], STDIN_FILENO) == -1) fatal("dup2: %s", errno_s); + env[0] = NULL; copy = kore_strdup(cmd); python_split_arguments(copy, argv, 32); - (void)execve(argv[0], argv, NULL); + + (void)execve(argv[0], argv, env); kore_log(LOG_ERR, "kore.proc failed to execute %s (%s)", argv[0], errno_s); exit(1);