GNU bug report logs -
#24206
25.1; Curly quotes generate invalid strings, leading to a segfault
Previous Next
Reported by: Phil <p.stephani2 <at> gmail.com>
Date: Thu, 11 Aug 2016 18:57:02 UTC
Severity: normal
Found in version 25.1
Done: Paul Eggert <eggert <at> cs.ucla.edu>
Bug is archived. No further changes may be made.
Full log
Message #67 received at 24206 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Andreas Schwab wrote:
> Unibyte strings should not be used for anything but pre-decoding /
> post-encoding situations directly after / before doing the actual I/O
> operation. Thus substitute-command-keys should never be called with an
> undecoded unibyte string. IMHO it would be ok to return something
> useless in this case (but it shouldn't cause Emacs to crash, of course).
Yes. This is in the Elisp manual, which says "We recommend that
you never use unibyte buffers and strings except for manipulating
encoded text or binary non-text data."
Eli Zaretskii wrote:
> as the original string is
> unibyte, the output of "\200≠", which is multibyte, might not be what
> the users expect. They might expect "\200\342\211\240" instead.
No, as per Andreas's comment and the Elisp reference manual, users should not
expect substitute-command-keys to do that. As long as it doesn't crash on
non-ASCII unibyte data we needn't sweat the details about whether it returns
unibyte or multibyte strings for such data.
That being said, it shouldn't hurt to return the original string if there is no
substitution. Although I think your first patch in
<http://bugs.gnu.org/24206#61> should work, it'd be safer and simpler to
backport that part of master, as in the attached patch to emacs-25.
[0001-Fix-core-dump-with-unibyte-substitute-command-keys.patch (text/x-diff, attachment)]
This bug report was last modified 8 years and 339 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.