]> git.tuebingen.mpg.de Git - paraslash.git/commit
server: Don't crash on blank moods.
authorAndre Noll <maan@tuebingen.mpg.de>
Thu, 6 May 2021 18:29:06 +0000 (20:29 +0200)
committerAndre Noll <maan@tuebingen.mpg.de>
Thu, 6 May 2021 18:29:06 +0000 (20:29 +0200)
commit5950bc81d20b5b6f9ddf1b34df3141cd542d2c6a
treea6f3be39bada718c3ba4c28f1fddc9bf36f8707e
parent3ccea2ef0eff8e9acc5d34528645d3e29bc9a4f9
server: Don't crash on blank moods.

We special-case empty mood definitions (because we can't map the
osl object anyway), but we don't check whether the mood definition
contains anything else than whitespace or comments.

Such blank mood definitions result in an empty abstract syntax tree
indicated by ->ast of the mood parser's context structure being
NULL. We happily dereference that pointer in mp_eval_row() and die
by the resulting SIGSEGV.

The fix is trivial: simply treat blank moods in the same way as the
dummy mood, i.e. regard each audio file as admissible.
mp.c