mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-21 18:23:03 +00:00
check for memory exhaustion
hash_initialize returns NULL when out of memory. Check for it, and die cleanly instead of crashing. Reported by 江 祖铭 (Zu-Ming Jiang). https://lists.gnu.org/archive/html/bug-bison/2019-08/msg00015.html * src/muscle-tab.c, src/state.c, src/symtab.c, src/uniqstr.c: Check the value returned by hash_initialize.
This commit is contained in:
@@ -128,6 +128,8 @@ muscle_init (void)
|
||||
|
||||
muscle_table = hash_initialize (HT_INITIAL_CAPACITY, NULL, hash_muscle,
|
||||
hash_compare_muscles, muscle_entry_free);
|
||||
if (!muscle_table)
|
||||
xalloc_die ();
|
||||
|
||||
/* Version and input file. */
|
||||
MUSCLE_INSERT_STRING ("version", VERSION);
|
||||
|
||||
Reference in New Issue
Block a user