summaryrefslogtreecommitdiffstats
path: root/apps/tagtree.c
diff options
context:
space:
mode:
authorWilliam Wilgus <me.theuser@yahoo.com>2018-12-22 12:45:02 -0600
committerWilliam Wilgus <me.theuser@yahoo.com>2019-07-10 09:38:36 +0200
commit3e27705eb9a68a07983c84b2771216c010c7ba21 (patch)
tree0680c3247e3c45a613c2ba00fe9884df56371c36 /apps/tagtree.c
parent5264a6eac109b83b799dc45c7cc99729090075b6 (diff)
downloadrockbox-3e27705eb9a68a07983c84b2771216c010c7ba21.tar.gz
rockbox-3e27705eb9a68a07983c84b2771216c010c7ba21.tar.bz2
rockbox-3e27705eb9a68a07983c84b2771216c010c7ba21.zip
tagtree.c->loadroot() guard against overflow
forum user chris_s noted an possible unhandled cache overflow Change-Id: Ia79399d6581ef6b635578896519fda8126c731d7
Diffstat (limited to 'apps/tagtree.c')
-rw-r--r--apps/tagtree.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/apps/tagtree.c b/apps/tagtree.c
index c188a900fa..12a7a74e5d 100644
--- a/apps/tagtree.c
+++ b/apps/tagtree.c
@@ -1627,6 +1627,9 @@ static int load_root(struct tree_context *c)
if (menu == NULL)
return 0;
+ if (menu->itemcount > c->cache.max_entries)
+ panicf("%s tree_cache too small", __func__);
+
for (i = 0; i < menu->itemcount; i++)
{
dptr->name = menu->items[i]->name;