Subject: Re: 25.1; Curly quotes generate invalid strings, leading to a segfault

From: Paul Eggert <[email-masked]>
Date: Sat, 13 Aug 2016 23:54:43 -0500

Thanks forreporting that, Phil. Ituncovered several bugs in 
substitute-command-keys,some predating the curved-quote changes in Emacs 
25. I installed a patch into Emacs master as commit 
2791580f5eaa65948a13ea4ea4952d03b4da795b and am closing the bug as fixed.

For Emacs 25 I propose installing the attached patch, which should avoid 
the emacs-goodies-el problem though it does not fix the other 
(presumably less-likely) bugs in this area. This patch is considerably 
simpler than what I just installed into master.

>From 2cbfb2adb97b086e24c05b24ebf6349a3b3b94c9 Mon Sep 17 00:00:00 2001
From: Paul Eggert <[email-masked]>
Date: Sat, 13 Aug 2016 23:38:33 -0500
Subject: [PATCH] Fix core dump with unibyte substitute-command-keys

* src/doc.c (Fsubstitute_command_keys): Convert string to
multibyte first (Bug#24206).  Do not merge to master.
---
 src/doc.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/doc.c b/src/doc.c
index 7cdb0d0..f664e0e 100644
--- a/src/doc.c
+++ b/src/doc.c
@@ -757,6 +757,7 @@ Otherwise, return a new string.  */)
     return Qnil;
 
   CHECK_STRING (string);
+  string = Fstring_make_multibyte (string);
   tem = Qnil;
   keymap = Qnil;
   name = Qnil;
-- 
2.5.5