Subject: xsrc/29003: Re: xsrc/29003: Bug in xterm (fwd)
To: None <xsrc-manager@netbsd.org, gnats-admin@netbsd.org,>
From: Thomas Dickey <dickey@his.com>
List: netbsd-bugs
Date: 01/18/2005 23:47:01
The following reply was made to PR xsrc/29003; it has been noted by GNATS.

From: Thomas Dickey <dickey@his.com>
To: Matthias Scheler <tron@NetBSD.org>
Cc: NetBSD GNATS <gnats-bugs@netbsd.org>
Subject: Re: xsrc/29003: Bug in xterm (fwd)
Date: Tue, 18 Jan 2005 18:46:19 -0500 (EST)

 On Tue, 18 Jan 2005, Matthias Scheler wrote:
 
 >
 > 	Hello Thomas,
 >
 > any wise words about this bug? :-)
 
 I hadn't seen that one (there were a lot of changes in #171 a couple of 
 years ago, mostly good but a few bugs).  A quick check shows 21 places in 
 the state table that can get there, including the default ansi_table. 
 That one looks like an error; the others I'll have to sift through and 
 check for other possible errors).  The
 
              if (!string_used)
                  break;
 
 does guard against most errors.
 
 Resetting the state to ground at the beginning does ensure that the check 
 if there's no string_used doesn't prevent the state from resetting 
 (agree).
 
 
 >
 > ----- Forwarded message from bqt@update.uu.se -----
 >
 > From: bqt@update.uu.se
 > To: xsrc-manager@netbsd.org, gnats-admin@netbsd.org, netbsd-bugs@netbsd.org
 > Reply-To: gnats-bugs@netbsd.org
 > Subject: xsrc/29003: Bug in xterm
 > Cc:
 > Date: Tue, 18 Jan 2005 22:27:00 +0000 (UTC)
 >
 >> Number:         29003
 >> Category:       xsrc
 >> Synopsis:       xterm get's confused by ST sequence
 >> Confidential:   no
 >> Severity:       non-critical
 >> Priority:       medium
 >> Responsible:    xsrc-manager
 >> State:          open
 >> Class:          sw-bug
 >> Submitter-Id:   net
 >> Arrival-Date:   Tue Jan 18 22:27:00 +0000 2005
 >> Originator:     Johnny Billquist
 >> Release:        NetBSD 2.99.12
 >> Organization:
 > Johnny Billquist                  || "I'm on a bus
 >                                  ||  on a psychedelic trip
 > email: bqt@update.uu.se           ||  Reading murder books
 > pdp is alive!                     ||  tryin' to stay hip" - B. Idol
 >> Environment:
 > System: NetBSD Junk.BQTnet.SE 2.99.12 NetBSD 2.99.12 (Junk) #0: Tue Jan 4 18:43:18 CET 2005 root@Junk.BQTnet.SE:/usr/obj/sys/arch/i386/compile/Junk i386
 > Architecture: i386
 > Machine: i386
 >> Description:
 > The ST sequence is used to terminate some of the more complex escape
 > sequences. If an ST is received while not parsing a sequence, xterm
 > gobbles up a few characters of the input stream.
 > The reason is that a state variable isn't reset from parsing the
 > escape sequence if the sequence is ST, and we're not currently
 > inside that more complex sequence.
 >> How-To-Repeat:
 > Just send the ST sequence, and watch the next character disappear.
 >> Fix:
 > Index: charproc.c
 > ===================================================================
 > RCS file: /cvsroot/xsrc/xfree/xc/programs/xterm/charproc.c,v
 > retrieving revision 1.5
 > diff -c -r1.5 charproc.c
 > *** charproc.c	5 Mar 2004 16:33:12 -0000	1.5
 > --- charproc.c	18 Jan 2005 22:21:51 -0000
 > ***************
 > *** 2164,2169 ****
 > --- 2164,2170 ----
 >  	    break;
 >
 >  	case CASE_ST:
 > + 	    parsestate = groundtable;
 >  	    if (!string_used)
 >  		break;
 >  	    string_area[--string_used] = '\0';
 > ***************
 > *** 2184,2190 ****
 >  		/* ignored */
 >  		break;
 >  	    }
 > - 	    parsestate = groundtable;
 >  	    break;
 >
 >  	case CASE_SOS:
 > --- 2185,2190 ----
 >
 > ----- End forwarded message -----
 >
 > 	Kind regards
 >
 > -- 
 > Matthias Scheler                                  http://scheler.de/~matthias/
 >
 
 -- 
 Thomas E. Dickey
 http://invisible-island.net
 ftp://invisible-island.net