From 86f7c723953672d317bade10fa45e919e6bec8ff Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Fri, 30 Oct 2015 18:53:54 +0000 Subject: Do not access a NULL pointer when a .Bd macro has no arguments at all. Bug reported by krw@. --- mdoc_state.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'mdoc_state.c') diff --git a/mdoc_state.c b/mdoc_state.c index 7fc76dcb..cbd73763 100644 --- a/mdoc_state.c +++ b/mdoc_state.c @@ -1,4 +1,4 @@ -/* $Id: mdoc_state.c,v 1.2 2015/10/21 23:51:11 schwarze Exp $ */ +/* $Id: mdoc_state.c,v 1.3 2015/10/30 18:53:54 schwarze Exp $ */ /* * Copyright (c) 2014, 2015 Ingo Schwarze * @@ -195,6 +195,9 @@ state_bd(STATE_ARGS) (n->type != ROFFT_BODY || n->end != ENDBODY_NOT)) return; + if (n->parent->args == NULL) + return; + arg = n->parent->args->argv[0].arg; if (arg != MDOC_Literal && arg != MDOC_Unfilled) return; -- cgit v1.2.3-56-ge451