summaryrefslogtreecommitdiffstats
path: root/apps/tagtree.c
diff options
context:
space:
mode:
authorMichael Hohmuth <sideral@rockbox.org>2011-06-14 20:54:26 +0000
committerMichael Hohmuth <sideral@rockbox.org>2011-06-14 20:54:26 +0000
commit851cac848a03fdcfc60a6681570239b5dd5e1b18 (patch)
treeffdd91e20093b8dd411f0f4ce5bbdd85d0367c8a /apps/tagtree.c
parent4456abb60133a15be256d58518378b3dd262aa81 (diff)
downloadrockbox-851cac848a03fdcfc60a6681570239b5dd5e1b18.tar.gz
rockbox-851cac848a03fdcfc60a6681570239b5dd5e1b18.tar.bz2
rockbox-851cac848a03fdcfc60a6681570239b5dd5e1b18.zip
Prevent out-of-bounds array access when a tagnavi config file defines too many %format specifications
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30006 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/tagtree.c')
-rw-r--r--apps/tagtree.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/apps/tagtree.c b/apps/tagtree.c
index a1c5640b74..9451387a66 100644
--- a/apps/tagtree.c
+++ b/apps/tagtree.c
@@ -462,6 +462,12 @@ static int get_format_str(struct display_format *fmt)
static int add_format(const char *buf)
{
+ if (format_count >= TAGMENU_MAX_FMTS)
+ {
+ logf("too many formats");
+ return -1;
+ }
+
strp = buf;
if (formats[format_count] == NULL)