[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#685458: xterm: Segmentation fault with -t option specified



On Wed, Aug 29, 2012 at 09:49:33AM +0200, Cyril Brulebois wrote:
> Hi,
> 
> Thomas Dickey <dickey@his.com> (28/08/2012):
> > however, I did make additional fixes (4 additional occurrences) in this
> > area, and the original report on which I based my changes wasn't for the
> > Tektronix option.
> > 
> > It would be nice if the Debian package were updated to #281 (two months
> > old).
> > 
> > I'm currently working on #282, and if there were fixes needed as a result
> > of updating to #281, those would be reflected in #282.
> 
> diff against current package is (excluding configure):
>  47 files changed, 3795 insertions(+), 1152 deletions(-)
> 
> Sorry, but this is not something I want to (or can) review as a maintainer,
> or as a release team member. Especially since there's AFAICT nothing like a
> git or svn repository I could clone to check individual commits.

Actually my suggestion was for a new unstable version (you appear to be
working on the assumption that I was proposing to propagate #281 to
testing, etc - not realistic given Debian's freeze/release process).

The change we're discussing was part of #280, and is (by itself) relatively
easy to review:

     * add   null-pointer   checks   to  input-method  caching  added  in
       [292]patch  #277  to  fix  a  problem  in  the exposure code, when
       deselecting a window (report by Kriston Rehberg).

Here are the relevant chunks:

--- charproc.c	2012/05/10 10:51:37	1.1205
+++ charproc.c	2012/05/24 18:02:25	1.1206
@@ -1,4 +1,4 @@
-/* $XTermId: charproc.c,v 1.1204 2012/05/10 10:32:49 tom Exp $ */
+/* $XTermId: charproc.c,v 1.1205 2012/05/10 10:51:37 tom Exp $ */
 
 /*
  * Copyright 1999-2011,2012 by Thomas E. Dickey
@@ -3970,7 +3970,7 @@
     XPoint spot;
     XVaNestedList list;
 
-    if (input->xic
+    if (input && input->xic
 	&& (ld = getLineData(screen, screen->cur_row)) != 0) {
 	spot.x = (short) LineCursorX(screen, ld, screen->cur_col);
 	spot.y = (short) (CursorY(screen, screen->cur_row) + xw->misc.xim_fs_ascent);
@@ -7474,7 +7474,7 @@
 {
     TInput *input = lookupTInput(xw, (Widget) xw);
 
-    if (input->xim) {
+    if (input && input->xim) {
 	XCloseIM(input->xim);
 	input->xim = 0;
 	TRACE(("freed screen->xim\n"));
@@ -8051,8 +8051,8 @@
 
     TRACE(("xim_destroy_cb im=%lx, client=%p, call=%p\n",
 	   (long) im, client_data, call_data));
-
-    input->xic = NULL;
+    if (input)
+	input->xic = NULL;
     XRegisterIMInstantiateCallback(XtDisplay(xw), NULL, NULL, NULL,
 				   xim_instantiate_cb, NULL);
 }

--- input.c	2012/03/15 00:01:30	1.334
+++ input.c	2012/05/24 18:02:25	1.335
@@ -1,4 +1,4 @@
-/* $XTermId: input.c,v 1.333 2012/01/07 02:01:05 tom Exp $ */
+/* $XTermId: input.c,v 1.334 2012/03/15 00:01:30 tom Exp $ */
 
 /*
  * Copyright 1999-2011,2012 by Thomas E. Dickey
@@ -832,7 +832,7 @@
     {
 #if OPT_I18N_SUPPORT && OPT_INPUT_METHOD
 	TInput *input = lookupTInput(xw, (Widget) xw);
-	if (input->xic) {
+	if (input && input->xic) {
 	    Status status_return;
 #if OPT_WIDE_CHARS
 	    if (screen->utf8_mode) {

--- misc.c	2012/05/07 23:35:34	1.588
+++ misc.c	2012/05/24 18:02:25	1.589
@@ -1,4 +1,4 @@
-/* $XTermId: misc.c,v 1.586 2012/04/15 16:00:56 tom Exp $ */
+/* $XTermId: misc.c,v 1.588 2012/05/07 23:35:34 tom Exp $ */
 
 /*
  * Copyright 1999-2011,2012 by Thomas E. Dickey
@@ -180,7 +180,7 @@
     {
 #if OPT_I18N_SUPPORT && OPT_INPUT_METHOD
 	TInput *input = lookupTInput(xw, (Widget) xw);
-	if (input->xic)
+	if (input && input->xic)
 	    XSetICFocus(input->xic);
 #endif
 
@@ -218,7 +218,7 @@
 	{
 #if OPT_I18N_SUPPORT && OPT_INPUT_METHOD
 	    TInput *input = lookupTInput(xw, (Widget) xw);
-	    if (input->xic)
+	    if (input && input->xic)
 		XUnsetICFocus(input->xic);
 #endif
 

-- 
Thomas E. Dickey <dickey@invisible-island.net>
http://invisible-island.net
ftp://invisible-island.net

Attachment: signature.asc
Description: Digital signature


Reply to: