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


Message #40 received at 24206 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Paul Eggert <eggert <at> cs.ucla.edu>
Cc: p.stephani2 <at> gmail.com, johnw <at> gnu.org, nicolas <at> petton.fr,
 24206 <at> debbugs.gnu.org
Subject: Re: 25.1; Curly quotes generate invalid strings, leading to a segfault
Date: Sun, 14 Aug 2016 20:21:43 +0300
> Cc: 24206-done <at> debbugs.gnu.org, Eli Zaretskii <eliz <at> gnu.org>,
>  John Wiegley <johnw <at> gnu.org>, Nicolas Petton <nicolas <at> petton.fr>
> From: Paul Eggert <eggert <at> cs.ucla.edu>
> Date: Sat, 13 Aug 2016 23:54:43 -0500
> 
> 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.

Paul, would you agree with the following alternative patch for the
release branch?

Phil, is the recipe you presented in this bug _exactly_ what
emacs-goodies-el does?  If not, could you please see if the proposed
patch below fixes the real-life use case as well, and if not, show
that use case?  TIA.

diff --git a/src/doc.c b/src/doc.c
index 7cdb0d0..bba30b4 100644
--- a/src/doc.c
+++ b/src/doc.c
@@ -965,7 +965,8 @@ Otherwise, return a new string.  */)
 	  }
 	}
       else if ((strp[0] == '`' || strp[0] == '\'')
-	       && quoting_style == CURVE_QUOTING_STYLE)
+	       && quoting_style == CURVE_QUOTING_STYLE
+	       && multibyte)
 	{
 	  start = (unsigned char const *) (strp[0] == '`' ? uLSQM : uRSQM);
 	  length = 1;




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.