bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#58232: 29.0.50; alloc.c:879: assertion failed: 0 < item_size && 0 <


From: Visuwesh
Subject: bug#58232: 29.0.50; alloc.c:879: assertion failed: 0 < item_size && 0 < nitems_incr_min && 0 <= n0 && -1 <= nitems_max
Date: Sun, 02 Oct 2022 15:17:52 +0530
User-agent: Gnus/5.13 (Gnus v5.13)

[Sunday October 02, 2022] Eli Zaretskii wrote:

> Ouch!  Please try the patch below.

The patch works, thanks!

> diff --git a/src/emacs.c b/src/emacs.c
> index 91bf0a9..00c381a 100644
> --- a/src/emacs.c
> +++ b/src/emacs.c
> @@ -932,7 +932,7 @@ load_pdump (int argc, char **argv)
>       exenamelen = prefix_length;
>      }
>    ptrdiff_t needed = exenamelen + strlen (suffix) + 1;
> -  dump_file = xpalloc (NULL, &bufsize, needed - bufsize, -1, 1);
> +  dump_file = xpalloc (NULL, &bufsize, max (1, needed - bufsize), -1, 1);
>    memcpy (dump_file, emacs_executable, exenamelen);
>    strcpy (dump_file + exenamelen, suffix);
>    result = pdumper_load (dump_file, emacs_executable);





reply via email to

[Prev in Thread] Current Thread [Next in Thread]