GNU bug report logs - #58232
29.0.50; alloc.c:879: assertion failed: 0 < item_size && 0 < nitems_incr_min && 0 <= n0 && -1 <= nitems_max

Previous Next

Package: emacs;

Reported by: Visuwesh <visuweshm <at> gmail.com>

Date: Sat, 1 Oct 2022 16:34:02 UTC

Severity: normal

Found in version 29.0.50

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Visuwesh <visuweshm <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 58232 <at> debbugs.gnu.org
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
[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);




This bug report was last modified 2 years and 256 days ago.

Previous Next


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