summaryrefslogtreecommitdiffstats
path: root/usr.bin/telnet
diff options
context:
space:
mode:
authoreric <eric@FreeBSD.org>2002-11-20 17:59:20 +0000
committereric <eric@FreeBSD.org>2002-11-20 17:59:20 +0000
commit15c7fa3d74fa4a5283696af6542fbd049951118e (patch)
tree5505ab58b2617ff4c4cacd7733e2b2d44fe53b2c /usr.bin/telnet
parent48261862cd3ae41a7c29d435bea07d3e715b2bfc (diff)
downloadFreeBSD-src-15c7fa3d74fa4a5283696af6542fbd049951118e.zip
FreeBSD-src-15c7fa3d74fa4a5283696af6542fbd049951118e.tar.gz
Be more careful when parsing arguments.
PR: 45476 MFC after: 5 days
Diffstat (limited to 'usr.bin/telnet')
-rw-r--r--usr.bin/telnet/commands.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/usr.bin/telnet/commands.c b/usr.bin/telnet/commands.c
index 90da71d..e0c5b62 100644
--- a/usr.bin/telnet/commands.c
+++ b/usr.bin/telnet/commands.c
@@ -2026,8 +2026,12 @@ tn(int argc, char *argv[])
#endif
(hostname = strrchr(hostp, ':')) == NULL)
hostname = strrchr(hostp, '@');
- hostname++;
- srcroute = 1;
+ if (hostname == NULL) {
+ hostname = hostp;
+ } else {
+ hostname++;
+ srcroute = 1;
+ }
} else
hostname = hostp;
if (!portp) {
OpenPOWER on IntegriCloud