commit 0408813b608baf146960d976d1b376acf4cf7e9f
parent ba9bc3b56e24c3652f4cd808463ad45f78579ba8
Author: Eskil Queseth <eskil.queseth@tutus.se>
Date: Thu, 30 Jul 2026 16:41:35 +0200
python: Ensure first element of env is always NULL
The env variable in python_kore_proc is not initialized by default.
When calling kore.proc with no env argument, this variable is never
written to, which means that we call execve with garbage env pointers.
Always writing NULL to the first element means that the execve call
won't read garbage data, since the env list is NULL terminated.
Diffstat:
1 file changed, 1 insertion(+), 0 deletions(-)
diff --git a/src/python.c b/src/python.c
@@ -2812,6 +2812,7 @@ python_kore_proc(PyObject *self, PyObject *args, PyObject *kwargs)
char *copy, *argv[32], *env[PYTHON_PROC_MAX_ENV + 1];
timeo = -1;
+ env[0] = NULL;
if (coro_running == NULL) {
PyErr_SetString(PyExc_RuntimeError,