diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2014-10-25 15:06:30 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2014-10-25 15:06:30 +0000 |
commit | ef7072c55061398de01299d9bc02d3a179fcb3bc (patch) | |
tree | adbf2ee61d57d8172ded5a660ea0e7263ceb818c | |
parent | 7b96ff8a068bfd465f5368284af0ef9bdd35797a (diff) | |
download | mandoc-ef7072c55061398de01299d9bc02d3a179fcb3bc.tar.gz |
Fix a NULL pointer dereference reported
by Theo Buehler <theo at math dot ethz dot ch> on tech at openbsd:
Do not attempt to parse empty equations.
-rw-r--r-- | eqn.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -684,7 +684,9 @@ eqn_parse(struct eqn_node *ep, struct eqn_box *parent) char sym[64]; const char *start; - assert(NULL != parent); + assert(parent != NULL); + if (ep->data == NULL) + return(-1); next_tok: tok = eqn_tok_parse(ep, &p); |