From 69f54c346ec87b3899a95b224628d8df313bbc85 Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Wed, 11 Feb 2015 14:15:12 +0000 Subject: do not access a NULL pointer if an .Eo block lacks a tail; found by jsg@ with afl, test case #16 --- mdoc_man.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'mdoc_man.c') diff --git a/mdoc_man.c b/mdoc_man.c index eee1e3a7..966ffa8c 100644 --- a/mdoc_man.c +++ b/mdoc_man.c @@ -1,4 +1,4 @@ -/* $Id: mdoc_man.c,v 1.85 2015/02/06 03:38:45 schwarze Exp $ */ +/* $Id: mdoc_man.c,v 1.86 2015/02/11 14:15:12 schwarze Exp $ */ /* * Copyright (c) 2011-2015 Ingo Schwarze * @@ -1140,9 +1140,8 @@ pre_eo(DECL_ARGS) n->child->end != ENDBODY_NOT) print_word("\\&"); else if (n->end != ENDBODY_NOT ? n->child != NULL : - n->parent->head->child != NULL && - (n->parent->body->child != NULL || - n->parent->tail->child != NULL)) + n->parent->head->child != NULL && (n->child != NULL || + (n->parent->tail != NULL && n->parent->tail->child != NULL))) outflags &= ~(MMAN_spc | MMAN_nl); return(1); } -- cgit v1.2.3-56-ge451