Subject: Re: bug#8344: (substring ...) crashes on large vectors

From: Andreas Schwab <[email-masked]>
Date: Sun, 27 Mar 2011 09:52:58 +0200

Paul Eggert <[email-masked]> 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, [email-masked]
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."