]> granicus.if.org Git - libass/commit
parse_tags: don't recurse for nested \t()
authorOleg Oshmyan <chortos@inbox.lv>
Thu, 4 Jan 2018 00:42:09 +0000 (02:42 +0200)
committerOleg Oshmyan <chortos@inbox.lv>
Mon, 8 Jan 2018 20:20:13 +0000 (22:20 +0200)
commit6835731c2fe4164a0c50bc91d12c43b2a2b4e799
tree05942ee78618aad94143c63fba57c3e5bb6d4773
parent691b422247552a86e9d3310c4f1ea096dc52a3f2
parse_tags: don't recurse for nested \t()

This fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=4892
(stack overflow on deeply nested \t()).

This is possible because parentheses do not nest and the first ')'
terminates the whole tag. Thus something like \t(\t(\t(\t(\t() can be
read in a simple loop with no recursion required. Recursion is also
not required if the ')' is missing entirely and the outermost \t(...
never ends.

See https://github.com/libass/libass/pull/296 for more backstory.
Changelog
libass/ass_parse.c