Date: Tue, 19 Nov 2002 22:18:38 GMT From: "Landon J. Fuller" <landonf@apple.com> To: FreeBSD-gnats-submit@FreeBSD.org Subject: bin/45476: [PATCH] telnet fails to check for strrchr failure when parsing source route specification Message-ID: <200211192218.gAJMIcZo066596@zadder.apple.com>
next in thread | raw e-mail | index | archive | help
>Number: 45476
>Category: bin
>Synopsis: [PATCH] telnet fails to check for strrchr failure when parsing source route specification
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Tue Nov 19 03:30:01 PST 2002
>Closed-Date:
>Last-Modified:
>Originator: Landon J. Fuller
>Release: FreeBSD 5.0-CURRENT i386
>Organization:
Apple Computer, Inc.
>Environment:
System: FreeBSD zadder 5.0-CURRENT FreeBSD 5.0-CURRENT #5: Sat Nov 9 01:41:12 GMT 2002 root@zadder:/usr/obj/usr/src/sys/ZADDER i386
>Description:
telnet fails to check for strrchr() returning NULL when parsing out a source route specification
>How-To-Repeat:
landonf@zadder> telnet
telnet> open !crash
Segmentation fault (core dumped)
>Fix:
--- telnet.diff begins here ---
Index: commands.c
===================================================================
RCS file: /home/ncvs/src/usr.bin/telnet/commands.c,v
retrieving revision 1.38
diff -u -r1.38 commands.c
--- commands.c 2002/10/02 00:29:34 1.38
+++ commands.c 2002/11/18 21:21:36
@@ -2026,8 +2026,12 @@
#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) {
--- telnet.diff ends here ---
>Release-Note:
>Audit-Trail:
>Unformatted:
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200211192218.gAJMIcZo066596>
