Commit 5fc1f2ff authored by Thomas Jahns's avatar Thomas Jahns 🤸
Browse files

Fix potential out-of-bounds access.

parent e8869e76
...@@ -49,6 +49,8 @@ void tableDefEntry(int tableID, int id, const char *name, ...@@ -49,6 +49,8 @@ void tableDefEntry(int tableID, int id, const char *name,
{ {
int item; int item;
if ( tableID >= 0 && tableID < MAX_TABLE ) { } else
Error("Invalid table ID %d", tableID);
item = parTable[tableID].npars++; item = parTable[tableID].npars++;
parTable[tableID].pars[item].id = id; parTable[tableID].pars[item].id = id;
parTable[tableID].pars[item].dupflags = 0; parTable[tableID].pars[item].dupflags = 0;
......
Supports Markdown
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