tagtree.c->loadroot() guard against overflow
forum user chris_s noted an possible unhandled cache overflow Change-Id: Ia79399d6581ef6b635578896519fda8126c731d7
This commit is contained in:
parent
5264a6eac1
commit
3e27705eb9
1 changed files with 3 additions and 0 deletions
|
@ -1627,6 +1627,9 @@ static int load_root(struct tree_context *c)
|
||||||
if (menu == NULL)
|
if (menu == NULL)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
if (menu->itemcount > c->cache.max_entries)
|
||||||
|
panicf("%s tree_cache too small", __func__);
|
||||||
|
|
||||||
for (i = 0; i < menu->itemcount; i++)
|
for (i = 0; i < menu->itemcount; i++)
|
||||||
{
|
{
|
||||||
dptr->name = menu->items[i]->name;
|
dptr->name = menu->items[i]->name;
|
||||||
|
|
Loading…
Reference in a new issue