1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-29 00:31:01 -08:00

* menu.c (grow_menu_items): Check for int overflow.

This commit is contained in:
Paul Eggert 2011-05-11 23:48:32 -07:00
parent d89eb65e6d
commit 5cc152c080
2 changed files with 4 additions and 0 deletions

View file

@ -1,5 +1,7 @@
2011-05-12 Paul Eggert <eggert@cs.ucla.edu>
* menu.c (grow_menu_items): Check for int overflow.
* xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
2011-05-11 Paul Eggert <eggert@cs.ucla.edu>

View file

@ -176,6 +176,8 @@ save_menu_items (void)
static void
grow_menu_items (void)
{
if ((INT_MAX - MENU_ITEMS_PANE_LENGTH) / 2 < menu_items_allocated)
memory_full ();
menu_items_allocated *= 2;
menu_items = larger_vector (menu_items, menu_items_allocated, Qnil);
}