emacs-diffs
[Top][All Lists]
Advanced

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

emacs-28 b30ef09919: Prevent crashes caused by invalid locale coding sys


From: Po Lu
Subject: emacs-28 b30ef09919: Prevent crashes caused by invalid locale coding systems
Date: Thu, 17 Feb 2022 02:44:08 -0500 (EST)

branch: emacs-28
commit b30ef0991915fbcab016a9485b1dece6f15f801c
Author: Po Lu <luangruo@yahoo.com>
Commit: Po Lu <luangruo@yahoo.com>

    Prevent crashes caused by invalid locale coding systems
    
    * src/xterm.c (handle_one_xevent): Prevent a signal inside
    `setup_coding_system' which crashes recent versions of GLib if
    the locale coding system is invalid.
    
    Do not merge to master.
---
 src/xterm.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/src/xterm.c b/src/xterm.c
index b80d45f855..59413eafd4 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -8739,6 +8739,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.  */



reply via email to

[Prev in Thread] Current Thread [Next in Thread]