From c59cc29ca60ef674801fce3c577160a0dacee94c Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Sun, 6 Apr 2025 00:49:44 +0000 Subject: child_spawn bugfix (error path could have i > n) Signed-off-by: Laurent Bercot --- src/libenvexec/child_spawn.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/libenvexec/child_spawn.c') diff --git a/src/libenvexec/child_spawn.c b/src/libenvexec/child_spawn.c index 164f1b2..62aedb9 100644 --- a/src/libenvexec/child_spawn.c +++ b/src/libenvexec/child_spawn.c @@ -35,6 +35,7 @@ pid_t child_spawn (char const *prog, char const *const *argv, char const *const m += uint_fmt(modifs + m, p[i][!(i & 1)]) ; if (i+1 < n) modifs[m++] = ',' ; } + i = n ; modifs[m++] = 0 ; env_mergen(newenv, envlen + 2, envp, envlen, modifs, m, 1) ; if (n) fa[0].x.fd2[1] = p[0][1] ; -- cgit v1.3.1