From e84c612e39e798cd75a5e407718a24803ed135b6 Mon Sep 17 00:00:00 2001 From: asmodai Date: Thu, 30 Nov 2000 13:10:01 +0000 Subject: [PATCH] String paranoia fix. Synched from normal telnet. git-svn-id: http://svn0.us-east.freebsd.org/base/head/contrib/telnet@69387 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f --- telnetd/telnetd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/telnetd/telnetd.c b/telnetd/telnetd.c index a5a7a03..9cf34b0 100644 --- a/telnetd/telnetd.c +++ b/telnetd/telnetd.c @@ -859,7 +859,7 @@ doit(who) fatal(net, "Out of ptys"); if ((pty = open(lp, 2)) >= 0) { - strcpy(line,lp); + strlcpy(line,lp,sizeof(line)); line[5] = 't'; break; } @@ -1158,7 +1158,7 @@ telnet(f, p, host) HN = Getstr("hn", &cp); IM = Getstr("im", &cp); if (HN && *HN) - (void) strcpy(host_name, HN); + (void) strlcpy(host_name, HN, sizeof(host_name)); if (IM == 0) IM = ""; } else {