GNU bug report logs - #8344
(substring ...) crashes on large vectors

Previous Next

Package: emacs;

Reported by: Paul Eggert <eggert <at> cs.ucla.edu>

Date: Fri, 25 Mar 2011 18:27:02 UTC

Severity: normal

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

Full log


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

From: Andreas Schwab <schwab <at> linux-m68k.org>
To: Paul Eggert <eggert <at> cs.ucla.edu>
Cc: 8344 <at> debbugs.gnu.org
Subject: Re: bug#8344: (substring ...) crashes on large vectors
Date: Sun, 27 Mar 2011 09:52:58 +0200
Paul Eggert <eggert <at> cs.ucla.edu> writes:

> @@ -373,10 +373,10 @@
>      path = Fsubstring (path, make_number (2), Qnil);
>  
>    new_argv_volatile = new_argv = (const unsigned char **)
> -    alloca (max (2, nargs - 2) * sizeof (char *));
> +    alloca ((nargs > 4 ? nargs - 2 : 2) * sizeof (char *));

That should perhaps be converted to use SAFE_ALLOCA.

Andreas.

-- 
Andreas Schwab, schwab <at> linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."




This bug report was last modified 14 years and 114 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.