projects
/
emacs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6c46aa2
)
Avoid assertion violation in 'xpalloc'
author
Eli Zaretskii
<eliz@gnu.org>
Sun, 2 Oct 2022 09:58:04 +0000
(12:58 +0300)
committer
Eli Zaretskii
<eliz@gnu.org>
Sun, 2 Oct 2022 09:58:04 +0000
(12:58 +0300)
* src/emacs.c (load_pdump): Ensure the 3rd argument of xpalloc is
always positive. (Bug#58232)
src/emacs.c
patch
|
blob
|
history
diff --git
a/src/emacs.c
b/src/emacs.c
index 0a90b0913be223a2ac92c0e4d2bf6225dfba754d..602fa802e0bc0dda414dd438ce3c91c177485839 100644
(file)
--- a/
src/emacs.c
+++ b/
src/emacs.c
@@
-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);