emacs-diffs
[Top][All Lists]
Advanced

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

master f47419766d: Improve safety of calls to vendor-specific-keysyms


From: Po Lu
Subject: master f47419766d: Improve safety of calls to vendor-specific-keysyms
Date: Tue, 20 Dec 2022 02:42:59 -0500 (EST)

branch: master
commit f47419766d219b043ed368c062e40dc78e41ed6e
Author: Po Lu <luangruo@yahoo.com>
Commit: Po Lu <luangruo@yahoo.com>

    Improve safety of calls to vendor-specific-keysyms
    
    * src/xterm.c (x_term_init): Wrap call to
    vendor-specific-keysyms inside safe_call.
---
 src/xterm.c | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/src/xterm.c b/src/xterm.c
index a1acfa8074..60d4816565 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -29894,13 +29894,17 @@ x_term_init (Lisp_Object display_name, char 
*xrm_option, char *resource_name)
          {
            char *vendor = ServerVendor (dpy);
 
-           /* Temporarily hide the partially initialized terminal.  */
+           /* Temporarily hide the partially initialized terminal.
+              Use safe_call so that if a signal happens, a partially
+              initialized display (and display connection) is not
+              kept around.  */
            terminal_list = terminal->next_terminal;
            unblock_input ();
-           kset_system_key_alist
-             (terminal->kboard,
-              call1 (Qvendor_specific_keysyms,
-                     vendor ? build_string (vendor) : empty_unibyte_string));
+           kset_system_key_alist (terminal->kboard,
+                                  safe_call1 (Qvendor_specific_keysyms,
+                                              (vendor
+                                               ? build_string (vendor)
+                                               : empty_unibyte_string)));
            block_input ();
            terminal->next_terminal = terminal_list;
            terminal_list = terminal;



reply via email to

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