From bdc06e9bc94f24fb26627f37bbd9b2ea636f46dd 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 | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'eqn.c') diff --git a/eqn.c b/eqn.c index 31e674d0..a64031b2 100644 --- a/eqn.c +++ b/eqn.c @@ -1,4 +1,4 @@ -/* $Id: eqn.c,v 1.55 2014/10/25 14:35:37 schwarze Exp $ */ +/* $Id: eqn.c,v 1.56 2014/10/25 15:06:30 schwarze Exp $ */ /* * Copyright (c) 2011, 2014 Kristaps Dzonsons * Copyright (c) 2014 Ingo Schwarze @@ -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 v1.2.3-56-ge451