diff options
author | kris <kris@FreeBSD.org> | 2000-11-19 10:08:26 +0000 |
---|---|---|
committer | kris <kris@FreeBSD.org> | 2000-11-19 10:08:26 +0000 |
commit | 1a1517afe4976245f010151c770a4abb32976ceb (patch) | |
tree | 5bd89431ebab2ee646b5e87f2640c954a2dfb7dd /usr.bin | |
parent | b9600b6040035f681b83eda8979335c946311ee1 (diff) | |
download | FreeBSD-src-1a1517afe4976245f010151c770a4abb32976ceb.zip FreeBSD-src-1a1517afe4976245f010151c770a4abb32976ceb.tar.gz |
Fix a buffer overflow from a long local hostname.
Obtained from: OpenBSD
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/telnet/commands.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/telnet/commands.c b/usr.bin/telnet/commands.c index 1ab5e54..c6b35e2 100644 --- a/usr.bin/telnet/commands.c +++ b/usr.bin/telnet/commands.c @@ -2721,12 +2721,12 @@ cmdrc(m1, m2) int gotmachine = 0; int l1 = strlen(m1); int l2 = strlen(m2); - char m1save[64]; + char m1save[MAXHOSTNAMELEN]; if (skiprc) return; - strcpy(m1save, m1); + strlcpy(m1save, m1, sizeof(m1save)); m1 = m1save; if (rcname == 0) { |