summaryrefslogtreecommitdiff
path: root/lib/libc_r
diff options
context:
space:
mode:
authorAlexander Leidinger <netchild@FreeBSD.org>2003-06-09 16:45:37 +0000
committerAlexander Leidinger <netchild@FreeBSD.org>2003-06-09 16:45:37 +0000
commitf970961773b3dd072c2e3cd0ac37bb37360855ac (patch)
tree616626eadaaf8de8ccdac2724d76e6090b4a00e2 /lib/libc_r
parentdff6f5103447581d66d60029e2e41ec1c83f4204 (diff)
Notes
Diffstat (limited to 'lib/libc_r')
-rw-r--r--lib/libc_r/uthread/uthread_close.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/libc_r/uthread/uthread_close.c b/lib/libc_r/uthread/uthread_close.c
index 0847fcd11529..ba291a3c884d 100644
--- a/lib/libc_r/uthread/uthread_close.c
+++ b/lib/libc_r/uthread/uthread_close.c
@@ -49,7 +49,8 @@ _close(int fd)
struct stat sb;
struct fd_table_entry *entry;
- if ((fd == _thread_kern_pipe[0]) || (fd == _thread_kern_pipe[1]) ||
+ if ((fd < 0) || (fd >= _thread_dtablesize) ||
+ (fd == _thread_kern_pipe[0]) || (fd == _thread_kern_pipe[1]) ||
(_thread_fd_table[fd] == NULL)) {
/*
* Don't allow silly programs to close the kernel pipe