diff options
Diffstat (limited to 'WWW/Library/Implementation/HTTCP.c')
-rw-r--r-- | WWW/Library/Implementation/HTTCP.c | 12 |
1 files changed, 12 insertions, 0 deletions
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; |