Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 7 Mar 2002 19:52:45 +0100 (CET)
From:      Nils M Holm <nmh@t3x.org>
To:        <FreeBSD-gnats-submit@freebsd.org>
Subject:   ports/35638: tn3270 dumps core unconditionally
Message-ID:  <20020307195059.K13350-100000@Symmetry.UUCP>

next in thread | raw e-mail | index | archive | help

>Number:         35638
>Category:       ports
>Synopsis:       tn3270 dumps core unconditionally
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Mar 07 11:00:01 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     Nils M Holm
>Release:        FreeBSD 4.4-RELEASE i386
>Organization:
>Environment:
System: FreeBSD Symmetry.UUCP 4.4-RELEASE FreeBSD 4.4-RELEASE #5: Sun Dec 16 16:52:03 CET 2001 nmh@Symmetry.UUCP:/usr/src/sys/compile/SYMMETRY i386

>Description:

	When starting tn3270, an infinite loop (by indirect recursion)
	is entered which finally causes a stack overflow and a core dump.

	The error is caused because the name of the 'setupterm' function
	is duplicated in the libcurses library and so setupterm() calls
	tgetent() and tgetent() calls setupterm(), etc.

	I have fixed that bug by renaming setupterm() in
	tn3270/telnet/telnet.c .

	Yes, the diff is probably not in the format you expect it to
	be, but it may be better than nothing at all.

>How-To-Repeat:

	Connect to a 3270 host and watch your machine freeze.

>Fix:
diff -ru work.orig/tn3270/telnet/telnet.c work/tn3270/telnet/telnet.c
--- work.orig/tn3270/telnet/telnet.c	Mon Aug 30 20:53:48 1999
+++ work/tn3270/telnet/telnet.c	Thu Mar  7 19:31:52 2002
@@ -738,7 +738,7 @@

 	/*ARGSUSED*/
 	int
-setupterm(tname, fd, errp)
+_setupterm(tname, fd, errp)
 	char *tname;
 	int fd, *errp;
 {
@@ -772,7 +772,7 @@
 		if (tnamep && tnamep != unknown)
 			free(tnamep);
 		if ((tname = (char *)env_getvalue((unsigned char *)"TERM")) &&
-				(setupterm(tname, 1, &err) == 0)) {
+				(_setupterm(tname, 1, &err) == 0)) {
 			tnamep = mklist(termbuf, tname);
 		} else {
 			if (tname && (strlen(tname) <= 40)) {

-- 
Nils M Holm <nmh@t3x.org> -- http://www.not-compatible.org/nmh/

>Release-Note:
>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020307195059.K13350-100000>