From 10f6c5df5fbd3e8a2be8a0640035680235b3f8a3 Mon Sep 17 00:00:00 2001 From: "Thomas E. Dickey" Date: Wed, 16 Dec 1998 22:06:07 -0500 Subject: snapshot of project "lynx", label v2-8-2dev_10 --- WWW/Library/Implementation/HTTCP.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'WWW/Library/Implementation/HTTCP.c') diff --git a/WWW/Library/Implementation/HTTCP.c b/WWW/Library/Implementation/HTTCP.c index 8ae0e0c3..42821b4e 100644 --- a/WWW/Library/Implementation/HTTCP.c +++ b/WWW/Library/Implementation/HTTCP.c @@ -1102,6 +1102,18 @@ PUBLIC int HTDoRead ARGS3( int nb; #endif /* UCX, BSN */ +#ifdef UNIX + if (fildes == 0) { + /* + * 0 can be a valid socket fd, but if it's a tty something must + * have gone wrong. - kw + */ + if (isatty(fildes)) { + CTRACE(tfp, "HTDoRead - refusing to read fd 0 which is a tty!\n"); + return -1; + } + } else +#endif if (fildes <= 0) return -1; -- cgit 1.4.1-2-gfad0