diff options
author | Aaron Campbell <aaron@cvs.openbsd.org> | 2000-11-08 21:49:45 +0000 |
---|---|---|
committer | Aaron Campbell <aaron@cvs.openbsd.org> | 2000-11-08 21:49:45 +0000 |
commit | 23b97cf9ae69afeda9d942690f6b4eb28562c045 (patch) | |
tree | 3ff840a182a31fefeeb26e282ccd6f110485022b /usr.bin | |
parent | 9eaabd14d443cefe0f82679d457ae31129b8c1ec (diff) |
Fix a buf oflow, only exposed because a user happened to have a host with a
resolvable name > 63 characters and specified a port number on the command
line; spotted by steve@tightrope.demon.co.uk, who provided a useful traceback.
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/telnet/commands.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/telnet/commands.c b/usr.bin/telnet/commands.c index 7324c0fb73b..6f1d1eeac3d 100644 --- a/usr.bin/telnet/commands.c +++ b/usr.bin/telnet/commands.c @@ -1,4 +1,4 @@ -/* $OpenBSD: commands.c,v 1.33 2000/10/10 15:41:10 millert Exp $ */ +/* $OpenBSD: commands.c,v 1.34 2000/11/08 21:49:44 aaron Exp $ */ /* $NetBSD: commands.c,v 1.14 1996/03/24 22:03:48 jtk Exp $ */ /* @@ -2191,12 +2191,12 @@ cmdrc(char *m1, char *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] == 0) { |