summaryrefslogtreecommitdiffstats
path: root/eqn.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2014-10-25 15:06:30 +0000
committerIngo Schwarze <schwarze@openbsd.org>2014-10-25 15:06:30 +0000
commitef7072c55061398de01299d9bc02d3a179fcb3bc (patch)
treeadbf2ee61d57d8172ded5a660ea0e7263ceb818c /eqn.c
parent7b96ff8a068bfd465f5368284af0ef9bdd35797a (diff)
downloadmandoc-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.
Diffstat (limited to 'eqn.c')
-rw-r--r--eqn.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/eqn.c b/eqn.c
index 2e77c484..ebe0c3e2 100644
--- a/eqn.c
+++ b/eqn.c
@@ -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);