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:
parent
d89eb65e6d
commit
5cc152c080
2 changed files with 4 additions and 0 deletions
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue