GNU bug report logs -
#56372
29.0.50; [PATCH] Avoid BadMatch X11 error
Previous Next
Reported by: dick.r.chiang <at> gmail.com
Date: Sun, 3 Jul 2022 22:04:02 UTC
Severity: normal
Tags: moreinfo, patch
Found in version 29.0.50
Fixed in version 29.1
Done: dick <dick.r.chiang <at> gmail.com>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
dick <dick.r.chiang <at> gmail.com> writes:
>>From 5d2442a836a5641f8f1c2b4a844fe510a77bd8c5 Mon Sep 17 00:00:00 2001
> From: dickmao <dick.r.chiang <at> gmail.com>
> Date: Mon, 4 Jul 2022 00:47:34 -0400
> Subject: [PATCH] Avoid segfault
>
> * src/xterm.c (x_connection_closed): Avoid segfault.
> ---
> src/xterm.c | 23 ++++++++++++-----------
> 1 file changed, 12 insertions(+), 11 deletions(-)
>
> diff --git a/src/xterm.c b/src/xterm.c
> index c5acb450837..464887da975 100644
> --- a/src/xterm.c
> +++ b/src/xterm.c
> @@ -23518,17 +23518,18 @@ x_connection_closed (Display *dpy, const char *error_message, bool ioerror)
>
> fprintf (stderr, "X error handlers currently installed:\n");
>
> - for (failable = dpyinfo->failable_requests;
> - failable < dpyinfo->next_failable_request;
> - ++failable)
> - {
> - if (failable->end)
> - fprintf (stderr, "Ignoring errors between %lu to %lu\n",
> - failable->start, failable->end);
> - else
> - fprintf (stderr, "Ignoring errors from %lu onwards\n",
> - failable->start);
> - }
> + if (dpyinfo)
> + for (failable = dpyinfo->failable_requests;
> + failable < dpyinfo->next_failable_request;
> + ++failable)
> + {
> + if (failable->end)
> + fprintf (stderr, "Ignoring errors between %lu to %lu\n",
> + failable->start, failable->end);
> + else
> + fprintf (stderr, "Ignoring errors from %lu onwards\n",
> + failable->start);
> + }
>
> for (stack = x_error_message; stack; stack = stack->prev)
> fprintf (stderr, "Trapping errors from %lu\n",
That piece of code is already inside "if (dpyinfo)" -- in fact, your
patch misses a use-after-free, which has already been fixed on master.
This bug report was last modified 3 years and 9 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.