From d8bf652ae69fcce08620033409dce0a059685420 Mon Sep 17 00:00:00 2001 From: Olaf Barthel Date: Sat, 12 Mar 2005 09:49:47 +0000 Subject: [PATCH] - Added a table size check to guard against accesses beyond the last file descriptor. git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14886 87f5fb63-7c3d-0410-a384-fd976d0f7a62 --- library/stdio_fdhookentry.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/library/stdio_fdhookentry.c b/library/stdio_fdhookentry.c index 5a31d63..34be47c 100644 --- a/library/stdio_fdhookentry.c +++ b/library/stdio_fdhookentry.c @@ -1,5 +1,5 @@ /* - * $Id: stdio_fdhookentry.c,v 1.20 2005-03-12 09:43:48 obarthel Exp $ + * $Id: stdio_fdhookentry.c,v 1.21 2005-03-12 09:49:47 obarthel Exp $ * * :ts=4 * @@ -84,11 +84,11 @@ __fd_hook_entry( { file = Input(); } - else if (fd == __fd[STDOUT_FILENO]) + else if (__num_fd > STDOUT_FILENO && fd == __fd[STDOUT_FILENO]) { file = Output(); } - else if (fd == __fd[STDERR_FILENO]) + else if (__num_fd > STDERR_FILENO && fd == __fd[STDERR_FILENO]) { #if defined(__amigaos4__) {