svn commit: r184938 - head/contrib/telnet/telnetd

Ed Schouten ed at FreeBSD.org
Thu Nov 13 12:40:38 PST 2008


Author: ed
Date: Thu Nov 13 20:40:38 2008
New Revision: 184938
URL: http://svn.freebsd.org/changeset/base/184938

Log:
  Use strlcpy() instead of strcpy().
  
  Requested by:	mlaier

Modified:
  head/contrib/telnet/telnetd/sys_term.c

Modified: head/contrib/telnet/telnetd/sys_term.c
==============================================================================
--- head/contrib/telnet/telnetd/sys_term.c	Thu Nov 13 19:57:33 2008	(r184937)
+++ head/contrib/telnet/telnetd/sys_term.c	Thu Nov 13 20:40:38 2008	(r184938)
@@ -414,7 +414,8 @@ getpty(int *ptynum __unused)
 	if (pn == NULL)
 		return (-1);
 	
-	strcpy(line, pn);
+	if (strlcpy(line, pn, sizeof line) >= sizeof line)
+		return (-1);
 
 	return (p);
 }


More information about the svn-src-head mailing list