about summary refs log tree commit diff stats
path: root/WWW/Library/Implementation/HTTCP.c
diff options
context:
space:
mode:
authorThomas E. Dickey <dickey@invisible-island.net>1998-12-16 22:06:07 -0500
committerThomas E. Dickey <dickey@invisible-island.net>1998-12-16 22:06:07 -0500
commit10f6c5df5fbd3e8a2be8a0640035680235b3f8a3 (patch)
treef46df4582b5b527aff7ed4294e065bc5b6076a33 /WWW/Library/Implementation/HTTCP.c
parent08fc6e5c6582f05f43c968931b04d698cf7abc86 (diff)
downloadlynx-snapshots-10f6c5df5fbd3e8a2be8a0640035680235b3f8a3.tar.gz
snapshot of project "lynx", label v2-8-2dev_10
Diffstat (limited to 'WWW/Library/Implementation/HTTCP.c')
-rw-r--r--WWW/Library/Implementation/HTTCP.c12
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;