]> git.eshelyaron.com Git - emacs.git/commit
SAFE_ALLOCA fixes
authorPaul Eggert <eggert@cs.ucla.edu>
Sat, 20 Jul 2024 15:52:55 +0000 (08:52 -0700)
committerEshel Yaron <me@eshelyaron.com>
Mon, 22 Jul 2024 10:38:08 +0000 (12:38 +0200)
commitf258c60f9fac3d781342ae4a3983e2a80da9b47e
treed786b5bb453804a8e68ed89845a8de072b47ea8c
parent53c8c9608c14f761e9793cdcf5263aea7af78bb4
SAFE_ALLOCA fixes

* src/comp.c (declare_imported_func, emit_simple_limple_call)
(declare_lex_function, compile_function):
* src/emacs-module.c (funcall_module):
* src/fns.c (Fstring_distance):
* src/font.c (font_sort_entities):
* src/haikumenu.c (digest_menu_items, haiku_menu_show):
* src/pgtkselect.c (Fpgtk_register_dnd_targets):
* src/xfns.c (Fx_begin_drag):
* src/xmenu.c (x_menu_show):
* src/xterm.c (x_dnd_compute_toplevels, handle_one_xevent)
(x_term_init):
Prefer SAFE_NALLOCA to doing size multiplication by hand, to catch
unlikely integer overflows.
* src/comp.c (emit_simple_limple_call): Fix bug where
SAFE_FREE was called too early, leading to unlikely
use of freed storage.
* src/xterm.c (handle_one_xevent): Remove side effects
from SAFE_ALLOCA args, as the args are evaluated twice.

(cherry picked from commit 101ec1430128a0b1d9e7d54cbd9c0add8f446f25)
src/comp.c
src/emacs-module.c
src/fns.c
src/font.c
src/haikumenu.c
src/pgtkselect.c
src/xfns.c
src/xmenu.c
src/xterm.c