mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-13 14:23:04 +00:00
* src/reader.c (packgram): Catch nitems overflows.
This commit is contained in:
@@ -1692,6 +1692,10 @@ packgram (void)
|
||||
int ruleno;
|
||||
symbol_list *p;
|
||||
|
||||
/* We use short to index items. */
|
||||
if (nitems >= MAXSHORT)
|
||||
fatal (_("too many items (max %d)"), MAXSHORT);
|
||||
|
||||
ritem = XCALLOC (short, nitems + 1);
|
||||
rule_table = XCALLOC (rule_t, nrules) - 1;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user