GNU bug report logs - #24206
25.1; Curly quotes generate invalid strings, leading to a segfault

Previous Next

Package: emacs;

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


View this message in rfc822 format

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: p.stephani2 <at> gmail.com, johnw <at> gnu.org, nicolas <at> petton.fr, 24206 <at> debbugs.gnu.org
Subject: bug#24206: 25.1; Curly quotes generate invalid strings, leading to a segfault
Date: Sun, 14 Aug 2016 09:51:43 -0500
On 08/14/2016 09:27 AM, Eli Zaretskii wrote:
> The "length = 1" part is only correct if the argument string is
> multibyte, and should otherwise count the number of bytes in
> uLSQM/uRSQ, right?

This string is by definition multibyte at that point, since that part of 
the code is inserting a Unicode character that is not ASCII.

More generally, Fsubstitute_command_keys is quite confused about unibyte 
versus multibyte issues. It merges together a number of strings, and 
assumes that they are all multibyte iff the original string is 
multibyte, which is obviously not true in general. (This problem is not 
limited to the requoting part of the code.) In master, I've altered the 
implementation to always generate either the original string, or an 
ASCII string, or a multibyte string. Since substitute-command-keys is 
not intended to be used on encoded unibyte text, that's good enough.





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.