From ef7072c55061398de01299d9bc02d3a179fcb3bc Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Sat, 25 Oct 2014 15:06:30 +0000 Subject: Fix a NULL pointer dereference reported by Theo Buehler on tech at openbsd: Do not attempt to parse empty equations. --- eqn.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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); -- cgit