Commit 5cc152c0 authored by Paul Eggert's avatar Paul Eggert
Browse files

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

parent d89eb65e
2011-05-12 Paul Eggert <eggert@cs.ucla.edu> 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. * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
2011-05-11 Paul Eggert <eggert@cs.ucla.edu> 2011-05-11 Paul Eggert <eggert@cs.ucla.edu>
......
...@@ -176,6 +176,8 @@ save_menu_items (void) ...@@ -176,6 +176,8 @@ save_menu_items (void)
static void static void
grow_menu_items (void) grow_menu_items (void)
{ {
if ((INT_MAX - MENU_ITEMS_PANE_LENGTH) / 2 < menu_items_allocated)
memory_full ();
menu_items_allocated *= 2; menu_items_allocated *= 2;
menu_items = larger_vector (menu_items, menu_items_allocated, Qnil); menu_items = larger_vector (menu_items, menu_items_allocated, Qnil);
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment