57e0022070059d8ecfe725d4faca5c669dbbeb0d — Simon Ser 6 months ago 5780296
Fix builtins I/O redirections

A out-of-bounds array access has been introduced in
fed10750771c5b061a80a9cb04e6a0de2405484c.
1 files changed, 1 insertions(+), 1 deletions(-)

M shell/task/command_builtin.c
M shell/task/command_builtin.c => shell/task/command_builtin.c +1 -1
@@ 52,7 52,7 @@
 
 	for (size_t i = 0; i < sc->io_redirects.len; ++i) {
 		struct mrsh_io_redirect *redir = sc->io_redirects.data[i];
-		struct saved_fd *saved = &fds[2 + i];
+		struct saved_fd *saved = &fds[i];
 
 		int redir_fd;
 		int fd = process_redir(redir, &redir_fd);