summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilliam Wilgus <wilgus.william@gmail.com>2024-06-04 17:35:28 -0400
committerWilliam Wilgus <me.theuser@yahoo.com>2024-06-04 17:40:28 -0400
commitfb39d852b0bf8fe6673b4531c17cc73094dc3ab0 (patch)
treef52b8bed4afa892b1c9fd65af125b2ae3816fab1
parent1b7d35126b1093f54f228384d1d19c066c9b9a9c (diff)
downloadrockbox-fb39d852b0.tar.gz
rockbox-fb39d852b0.zip
[coverity] tagtree.c tagtree_enter selected_item_history guard against overrun
Change-Id: I795b635d44b1002a557236dc8f78db79ab2c3348
-rw-r--r--apps/tagtree.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/apps/tagtree.c b/apps/tagtree.c
index be728dcc95..0aa1de5673 100644
--- a/apps/tagtree.c
+++ b/apps/tagtree.c
@@ -1897,7 +1897,8 @@ int tagtree_enter(struct tree_context* c, bool is_visible)
|| is_random_item)
{
max_history_level = c->dirlevel + 1;
- selected_item_history[c->dirlevel + 1] = 0;
+ if (max_history_level < MAX_DIR_LEVELS)
+ selected_item_history[max_history_level] = 0;
}
selected_item_history[c->dirlevel]=c->selected_item;