kore

An easy to use, scalable and secure web application framework for writing web APIs in C.
Commits | Files | Refs | README | LICENSE | git clone https://git.kore.io/kore.git

commit daca80f1cb25735ff992ecf87ab67c29e7bed98b
parent 96d1396df1c2a0ca07260985fa25e301bf50e7d5
Author: Joris Vink <joris@coders.se>
Date:   Sun, 20 Feb 2022 21:20:14 +0100

execve() its envp shouldn't be NULL.

Diffstat:
src/python.c | 6++++--
1 file changed, 4 insertions(+), 2 deletions(-)

diff --git 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);