From d904cf9f8e1a19eda34f70191a2f14b39f77f56e Mon Sep 17 00:00:00 2001 From: Jeroen Ruigrok van der Werven Date: Thu, 30 Nov 2000 13:10:01 +0000 Subject: [PATCH] String paranoia fix. Synched from normal telnet. --- contrib/telnet/telnetd/telnetd.c | 4 ++-- crypto/telnet/telnetd/telnetd.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/contrib/telnet/telnetd/telnetd.c b/contrib/telnet/telnetd/telnetd.c index a5a7a035a6fe..9cf34b05d544 100644 --- a/contrib/telnet/telnetd/telnetd.c +++ b/contrib/telnet/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 { diff --git a/crypto/telnet/telnetd/telnetd.c b/crypto/telnet/telnetd/telnetd.c index a5a7a035a6fe..9cf34b05d544 100644 --- a/crypto/telnet/telnetd/telnetd.c +++ b/crypto/telnet/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 {