]> git.eshelyaron.com Git - emacs.git/commitdiff
Improve safety of calls to vendor-specific-keysyms
authorPo Lu <luangruo@yahoo.com>
Tue, 20 Dec 2022 07:42:26 +0000 (15:42 +0800)
committerPo Lu <luangruo@yahoo.com>
Tue, 20 Dec 2022 07:42:45 +0000 (15:42 +0800)
* src/xterm.c (x_term_init): Wrap call to
vendor-specific-keysyms inside safe_call.

src/xterm.c

index a1acfa80744e4f168cd7407c7e669c3cc008fe6c..60d4816565082f774d3b29eaaf8177a4070a6e48 100644 (file)
@@ -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;