[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: master 6ed1994d27: Prevent crashes from illegal locale coding system
From: |
Po Lu |
Subject: |
Re: master 6ed1994d27: Prevent crashes from illegal locale coding systems |
Date: |
Thu, 17 Feb 2022 08:45:19 +0800 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.91 (gnu/linux) |
Eli Zaretskii <eliz@gnu.org> writes:
> This isn't right, IMO. You should decode using Qraw_text in the
> problematic case. Dropping the bytes on the floor is too radical,
> certainly for the release branch.
How about something like this?
diff --git a/src/xterm.c b/src/xterm.c
index b55a54b945..53d89240f1 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -8734,6 +8734,15 @@ handle_one_xevent (struct x_display_info *dpyinfo,
{
/* Decode the input data. */
+#ifdef HAVE_GLIB
+ /* If this isn't done in a build with GLib (usually
+ with GTK), then the resulting signal in
+ `setup_coding_system' will cause Emacs to
+ crash. */
+ if (NILP (Fcoding_system_p (coding_system)))
+ coding_system = Qraw_text;
+#endif
+
/* The input should be decoded with `coding_system'
which depends on which X*LookupString function
we used just above and the locale. */
- Re: master 6ed1994d27: Prevent crashes from illegal locale coding systems, (continued)
- Re: master 6ed1994d27: Prevent crashes from illegal locale coding systems, Po Lu, 2022/02/15
- Re: master 6ed1994d27: Prevent crashes from illegal locale coding systems, Po Lu, 2022/02/15
- Re: master 6ed1994d27: Prevent crashes from illegal locale coding systems, Po Lu, 2022/02/16
- Re: master 6ed1994d27: Prevent crashes from illegal locale coding systems, Eli Zaretskii, 2022/02/16
- Re: master 6ed1994d27: Prevent crashes from illegal locale coding systems, Po Lu, 2022/02/16
- Re: master 6ed1994d27: Prevent crashes from illegal locale coding systems, Eli Zaretskii, 2022/02/16
- Re: master 6ed1994d27: Prevent crashes from illegal locale coding systems, Po Lu, 2022/02/16
- Re: master 6ed1994d27: Prevent crashes from illegal locale coding systems, Eli Zaretskii, 2022/02/16
- Re: master 6ed1994d27: Prevent crashes from illegal locale coding systems, Po Lu, 2022/02/16
- Re: master 6ed1994d27: Prevent crashes from illegal locale coding systems, Eli Zaretskii, 2022/02/16
- Re: master 6ed1994d27: Prevent crashes from illegal locale coding systems,
Po Lu <=
- Re: master 6ed1994d27: Prevent crashes from illegal locale coding systems, Eli Zaretskii, 2022/02/17
- Re: master 6ed1994d27: Prevent crashes from illegal locale coding systems, Po Lu, 2022/02/17
- Re: master 6ed1994d27: Prevent crashes from illegal locale coding systems, Eli Zaretskii, 2022/02/17
- Re: master 6ed1994d27: Prevent crashes from illegal locale coding systems, Po Lu, 2022/02/17