SML parser: prevent out-of-bound array access
array nodes has MAX_TREE_SIZE elements, so the maximum index allowed to use to access an element of nodes is one less, not MAX_TREE_SIZE.
This commit is contained in:
parent
a1138a2202
commit
1afa9a6d90
@ -80,7 +80,7 @@ void pushListBuffer(unsigned char byte)
|
||||
|
||||
void reduceList()
|
||||
{
|
||||
if (currentLevel <= MAX_TREE_SIZE && nodes[currentLevel] > 0)
|
||||
if (currentLevel < MAX_TREE_SIZE && nodes[currentLevel] > 0)
|
||||
nodes[currentLevel]--;
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user