From 3e27705eb9a68a07983c84b2771216c010c7ba21 Mon Sep 17 00:00:00 2001 From: William Wilgus Date: Sat, 22 Dec 2018 12:45:02 -0600 Subject: [PATCH] tagtree.c->loadroot() guard against overflow forum user chris_s noted an possible unhandled cache overflow Change-Id: Ia79399d6581ef6b635578896519fda8126c731d7 --- apps/tagtree.c | 3 +++ 1 file changed, 3 insertions(+) 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;