* src/reader.c (packgram): Catch nitems overflows.

This commit is contained in:
Akim Demaille
2001-12-27 18:06:41 +00:00
parent 14d293acb2
commit adc8c84856
3 changed files with 14 additions and 0 deletions

View File

@@ -1,3 +1,8 @@
2001-12-27 Akim Demaille <akim@epita.fr>
* src/reader.c (packgram): Catch nitems overflows.
2001-12-27 Akim Demaille <akim@epita.fr>
* src/files.c, src/files.h (guard_obstack): Remove.

5
NEWS
View File

@@ -2,6 +2,11 @@ Bison News
----------
Changes in version 1.49a:
* items overflow
Bison no longer dumps core when there are too many items, it just
dies.
Changes in version 1.30:

View File

@@ -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;