]> git.eshelyaron.com Git - emacs.git/commitdiff
* w32select.c (Fw32_set_clipboard_data): Make coding iso2022 safe.
authorJason Rumney <jasonr@gnu.org>
Tue, 3 Feb 2004 23:44:47 +0000 (23:44 +0000)
committerJason Rumney <jasonr@gnu.org>
Tue, 3 Feb 2004 23:44:47 +0000 (23:44 +0000)
* w32fns.c (x_to_w32_font): Likewise.

src/ChangeLog
src/w32fns.c
src/w32select.c

index 4bda31d9a014a4c550ab964396a7f4d330ec23f0..1e44a98d42dd77b83cc98371ad3ae2b0b393f6b7 100644 (file)
@@ -1,3 +1,9 @@
+2004-02-03  Jason Rumney  <jasonr@gnu.org>
+
+       * w32select.c (Fw32_set_clipboard_data): Make coding iso2022 safe.
+
+       * w32fns.c (x_to_w32_font): Likewise.
+
 2004-02-03  Jan Dj\e,Ad\e(Brv  <jan.h.d@swipnet.se>
 
        * xterm.h: Add x_handle_dnd_message, x_check_property_data,
index 1854c3908bd71f01cfb7981a36451481d56d73bb..f296c17159519f97b649419ec6630fe6a6939dad 100644 (file)
@@ -5558,6 +5558,11 @@ x_to_w32_font (lpxstr, lplogfont)
             (Fcheck_coding_system (Vlocale_coding_system), &coding);
          coding.src_multibyte = 1;
          coding.dst_multibyte = 1;
+         /* Need to set COMPOSITION_DISABLED, otherwise Emacs crashes in
+            encode_coding_iso2022 trying to dereference a null pointer.  */
+         coding.composing = COMPOSITION_DISABLED;
+         if (coding.type == coding_type_iso2022)
+           coding.flags |= CODING_FLAG_ISO_SAFE;
          bufsize = encoding_buffer_size (&coding, strlen (name));
          buf = (unsigned char *) alloca (bufsize);
           coding.mode |= CODING_MODE_LAST_BLOCK;
index 6533f4b660d124daadeb45d5bc7393986e1fe51c..940cce35772ff48b5a5cf1a7b2828af5ba32faf5 100644 (file)
@@ -212,6 +212,11 @@ DEFUN ("w32-set-clipboard-data", Fw32_set_clipboard_data,
          }
        coding.src_multibyte = 1;
        coding.dst_multibyte = 0;
+       /* Need to set COMPOSITION_DISABLED, otherwise Emacs crashes in
+          encode_coding_iso2022 trying to dereference a null pointer.  */
+       coding.composing = COMPOSITION_DISABLED;
+       if (coding.type == coding_type_iso2022)
+         coding.flags |= CODING_FLAG_ISO_SAFE;
        Vnext_selection_coding_system = Qnil;
        coding.mode |= CODING_MODE_LAST_BLOCK;
        bufsize = encoding_buffer_size (&coding, nbytes);