Index: ext.h
===================================================================
RCS file: /home/ncvs/src/libexec/telnetd/ext.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- ext.h	1999/08/28 00:10:22	1.7
+++ ext.h	2000/11/19 10:01:27	1.8
@@ -87,7 +87,7 @@
 #endif
 
 extern int	pty, net;
-extern char	*line;
+extern char	line[16];
 extern int	SYNCHing;		/* we are in TELNET SYNCH mode */
 
 #ifndef	P
Index: sys_term.c
===================================================================
RCS file: /home/ncvs/src/libexec/telnetd/sys_term.c,v
retrieving revision 1.24
retrieving revision 1.26
diff -u -r1.24 -r1.26
--- sys_term.c	1999/08/28 00:10:24	1.24
+++ sys_term.c	2000/11/19 10:01:27	1.26
@@ -480,14 +480,10 @@
  *
  * Returns the file descriptor of the opened pty.
  */
-#ifndef	__GNUC__
-char *line = "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0";
-#else
-static char Xline[] = "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0";
-char *line = Xline;
-#endif
 #ifdef	CRAY
-char *myline = "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0";
+char myline[16];
+#else
+char line[16];
 #endif	/* CRAY */
 
 	int
@@ -1799,6 +1795,13 @@
 		    strncmp(*cpp, "_RLD_", 5) &&
 		    strncmp(*cpp, "LIBPATH=", 8) &&
 #endif
+		    strncmp(*cpp, "LOCALDOMAIN=", 12) &&
+		    strncmp(*cpp, "RES_OPTIONS=", 12) &&
+		    strncmp(*cpp, "TERMINFO=", 9) &&
+		    strncmp(*cpp, "TERMINFO_DIRS=", 14) &&
+		    strncmp(*cpp, "TERMPATH=", 9) &&
+		    strncmp(*cpp, "TERMCAP=/", 9) &&
+		    strncmp(*cpp, "ENV=", 4) &&
 		    strncmp(*cpp, "IFS=", 4))
 			*cpp2++ = *cpp;
 	}
Index: telnetd.c
===================================================================
RCS file: /home/ncvs/src/libexec/telnetd/telnetd.c,v
retrieving revision 1.22
retrieving revision 1.24
diff -u -r1.22 -r1.24
--- telnetd.c	2000/01/25 14:52:00	1.22
+++ telnetd.c	2000/11/19 10:01:27	1.24
@@ -805,13 +805,12 @@
 #else
 	for (;;) {
 		char *lp;
-		extern char *line, *getpty();
 
 		if ((lp = getpty()) == NULL)
 			fatal(net, "Out of ptys");
 
 		if ((pty = open(lp, 2)) >= 0) {
-			strcpy(line,lp);
+			strlcpy(line,lp,sizeof(line));
 			line[5] = 't';
 			break;
 		}
@@ -1115,7 +1114,7 @@
 		IM = Getstr("im", &cp);
 		IF = Getstr("if", &cp);
 		if (HN && *HN)
-			(void) strcpy(host_name, HN);
+			(void) strlcpy(host_name, HN, sizeof(host_name));
 		if (IF && (if_fd = open(IF, O_RDONLY, 000)) != -1)
 			IM = 0;
 		if (IM == 0)
Index: utility.c
===================================================================
RCS file: /home/ncvs/src/libexec/telnetd/utility.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- utility.c	1999/08/28 00:10:25	1.13
+++ utility.c	2000/10/31 05:29:54	1.14
@@ -330,7 +330,7 @@
 {
 	char buf[BUFSIZ];
 
-	(void) sprintf(buf, "telnetd: %s.\r\n", msg);
+	(void) snprintf(buf, sizeof(buf), "telnetd: %s.\r\n", msg);
 	(void) write(f, buf, (int)strlen(buf));
 	sleep(1);	/*XXX*/
 	exit(1);
@@ -343,7 +343,7 @@
 {
 	char buf[BUFSIZ], *strerror();
 
-	(void) sprintf(buf, "%s: %s", msg, strerror(errno));
+	(void) snprintf(buf, sizeof(buf), "%s: %s", msg, strerror(errno));
 	fatal(f, buf);
 }
 

