mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-01-09 05:01:02 -08:00
Avoid assertion violation in 'xpalloc'
* src/emacs.c (load_pdump): Ensure the 3rd argument of xpalloc is always positive. (Bug#58232)
This commit is contained in:
parent
6c46aa2116
commit
7ff5207624
1 changed files with 1 additions and 1 deletions
|
|
@ -903,7 +903,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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue