summaryrefslogtreecommitdiffstats
path: root/lib/skin_parser
diff options
context:
space:
mode:
authorThomas Martitz <kugel@rockbox.org>2010-11-05 18:46:21 +0000
committerThomas Martitz <kugel@rockbox.org>2010-11-05 18:46:21 +0000
commitd98f2929e9c07505056d846d1d309f1e16694ce7 (patch)
tree01da35d26af935bd81403414b15b9f9fc8ecd4ea /lib/skin_parser
parentbf679fa4ac2058f928ed38385e24af3f85e52e87 (diff)
downloadrockbox-d98f2929e9c07505056d846d1d309f1e16694ce7.tar.gz
rockbox-d98f2929e9c07505056d846d1d309f1e16694ce7.zip
Fix unchecked result skin_parse_tag() exposed by r28480.
It caused the parser to not see that skin parsing failed and to enter an infinite loop. And as a result it continued to endlessly malloc(). In normal build the skin buffer size limit made it end. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28497 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'lib/skin_parser')
-rw-r--r--lib/skin_parser/skin_parser.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/skin_parser/skin_parser.c b/lib/skin_parser/skin_parser.c
index 5a5d746c8e..80f5f61699 100644
--- a/lib/skin_parser/skin_parser.c
+++ b/lib/skin_parser/skin_parser.c
@@ -144,7 +144,8 @@ static struct skin_element* skin_parse_viewport(const char** document)
/* Parsing out the viewport tag if there is one */
if(check_viewport(cursor))
{
- skin_parse_tag(retval, &cursor);
+ if (!skin_parse_tag(retval, &cursor))
+ return NULL;
if(*cursor == '\n')
{
cursor++;