diff options
author | Po Lu <luangruo@yahoo.com> | 2022-02-17 15:35:41 +0800 |
---|---|---|
committer | Po Lu <luangruo@yahoo.com> | 2022-02-17 15:35:41 +0800 |
commit | b30ef0991915fbcab016a9485b1dece6f15f801c (patch) | |
tree | ab1c7e48218b62f4b1a47c44372bcfa83ca8bd2b /src | |
parent | c8442df581feb45d50530b372152beff9d23211d (diff) | |
download | emacs-b30ef0991915fbcab016a9485b1dece6f15f801c.tar.gz emacs-b30ef0991915fbcab016a9485b1dece6f15f801c.tar.bz2 emacs-b30ef0991915fbcab016a9485b1dece6f15f801c.zip |
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.
Diffstat (limited to 'src')
-rw-r--r-- | src/xterm.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/xterm.c b/src/xterm.c index b80d45f8552..59413eafd48 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. */ |