From 17e3f742f15313d7f44537f03bf85cf6e6ed4216 Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Mon, 2 May 2011 12:32:41 +0000 Subject: 29129: reading of end of fd array --- Src/exec.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'Src/exec.c') diff --git a/Src/exec.c b/Src/exec.c index 9c72c68af..a06f2f3ac 100644 --- a/Src/exec.c +++ b/Src/exec.c @@ -3008,10 +3008,11 @@ execcmd(Estate state, int input, int output, int how, int last1) if (!checkclobberparam(fn)) fil = -1; else if (fn->fd2 > 9 && - ((fdtable[fn->fd2] != FDT_UNUSED && - fdtable[fn->fd2] != FDT_EXTERNAL) || - fn->fd2 == coprocin || - fn->fd2 == coprocout)) { + (fn->fd2 > max_zsh_fd || + (fdtable[fn->fd2] != FDT_UNUSED && + fdtable[fn->fd2] != FDT_EXTERNAL) || + fn->fd2 == coprocin || + fn->fd2 == coprocout)) { fil = -1; errno = EBADF; } else { -- cgit 1.4.1