From edwin@d9168.dtk.chello.nl  Sun Nov 12 03:40:50 2000
Return-Path: <edwin@d9168.dtk.chello.nl>
Received: from d9168.dtk.chello.nl (d9168.dtk.chello.nl [213.46.9.168])
	by hub.freebsd.org (Postfix) with ESMTP id 581BD37B479
	for <FreeBSD-gnats-submit@freebsd.org>; Sun, 12 Nov 2000 03:40:46 -0800 (PST)
Received: by d9168.dtk.chello.nl (Postfix, from userid 1001)
	id 605C337A; Sun, 12 Nov 2000 12:40:35 +0100 (CET)
Message-Id: <20001112114035.605C337A@d9168.dtk.chello.nl>
Date: Sun, 12 Nov 2000 12:40:35 +0100 (CET)
From: mavetju@chello.nl
Sender: edwin@d9168.dtk.chello.nl
Reply-To: mavetju@chello.nl
To: FreeBSD-gnats-submit@freebsd.org
Subject: [PATCH] telnet dumps core after connecting to host with long name
X-Send-Pr-Version: 3.2

>Number:         22787
>Category:       bin
>Synopsis:       telnet dumps core after connecting to a host with a long name
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Nov 12 03:50:00 PST 2000
>Closed-Date:    Sun Nov 26 13:38:32 PST 2000
>Last-Modified:  Sun Nov 26 13:40:50 PST 2000
>Originator:     Edwin Groothuis
>Release:        FreeBSD 4.0-RELEASE i386
>Organization:
-
>Environment:

	standard freebsd system

>Description:

	As described in freebsd-questions last week:
	telnet dumps core when trying to connect to
	www.llanfairpwllgwyngyllgogerychwyrndrobwllllantysiliogogogoch.co.uk

>How-To-Repeat:

	[~] edwin@p6>telnet www.llanfairpwllgwyngyllgogerychwyrndrobwllllantysiliogogogoch.co.uk 80
	Trying 194.42.244.17...
	Illegal instruction (core dumped)

>Fix:

	Note: it will *still* crash now on systems which don't have
	MAXHOSTNAMELEN defined in sys/params.h.

--- /usr/src/usr.bin/telnet/commands.c  Fri Mar  3 12:13:09 2000
+++ commands.c  Sun Nov 12 12:35:13 2000
@@ -2723,7 +2723,7 @@
     int gotmachine = 0;
     int l1 = strlen(m1);
     int l2 = strlen(m2);
-    char m1save[64];
+    char m1save[MAXHOSTNAMELEN];
 
     if (skiprc)
        return;



>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: kris 
State-Changed-When: Sun Nov 26 13:38:32 PST 2000 
State-Changed-Why:  
I corrected the definition of MAXHOSTNAMELEN in the ifdef'ed code 
as well. Thanks for the bug report. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=22787 
>Unformatted:
